Solidity-comments

提供:Dev Guides
2020年6月23日 (火) 03:39時点におけるMaintenance script (トーク | 投稿記録)による版 (Imported from text file)
(差分) ← 古い版 | 最新版 (差分) | 新しい版 → (差分)
移動先:案内検索

堅牢性-コメント

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;
}