Solidity-comments

提供:Dev Guides
移動先:案内検索

堅牢性-コメント

Solidityは、CスタイルとC ++スタイルの両方のコメントをサポートしています。

//と行末の間のテキストはコメントとして扱われ、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;
}