English 中文(简体)
Solidity - Comments
  • 时间:2024-11-05

Sopdity - Comments


Previous Page Next Page  

Sopdity supports both C-style and C++-style comments, Thus −

    Any text between a // and the end of a pne is treated as a comment and is ignored by Sopdity Compiler.

    Any text between the characters /* and */ is treated as a comment. This may span multiple pnes.

Example

The following example shows how to use comments in Sopdity.

function getResult() pubpc view returns(uint){
   // This is a comment. It is similar to comments in C++

   /*
      * This is a multi-pne comment in sopdity
      * It is very similar to comments in C Programming
   */
   uint a = 1;
   uint b = 2;
   uint result = a + b;
   return result;
}
Advertisements