Solidity - ความคิดเห็น
Solidity รองรับทั้งความคิดเห็นสไตล์ C และ C ++ ด้วยประการฉะนี้ -
ข้อความใด ๆ ระหว่าง a // และท้ายบรรทัดจะถือว่าเป็นข้อคิดเห็นและ Solidity Compiler จะไม่สนใจ
ข้อความใด ๆ ระหว่างอักขระ / * และ * / จะถือว่าเป็นความคิดเห็น ซึ่งอาจครอบคลุมหลายบรรทัด
ตัวอย่าง
ตัวอย่างต่อไปนี้แสดงวิธีใช้ข้อคิดเห็นใน Solidity
function getResult() public view returns(uint){
// This is a comment. It is similar to comments in C++
/*
* This is a multi-line comment in solidity
* It is very similar to comments in C Programming
*/
uint a = 1;
uint b = 2;
uint result = a + b;
return result;
}