<example> ドキュメント タグ

<example> タグを使用すると、メソッドまたは他のライブラリ メンバーの使用例を指定できます。 通常、このタグを使用する場合は <code> タグも使用します。

構文

/// <example>description</example>

パラメーター

description
コード例の説明です。

Remarks

コンパイル時に /doc を指定して、ドキュメント コメントをファイルに出力します。

// xml_example_tag.cpp
// compile with: /clr /doc /LD
// post-build command: xdcmake xml_example_tag.dll

/// Text for class MyClass.
public ref class MyClass {
public:
   /// <summary>
   /// GetZero method
   /// </summary>
   /// <example> This sample shows how to call the GetZero method.
   /// <code>
   /// int main()
   /// {
   ///    return GetZero();
   /// }
   /// </code>
   /// </example>
   static int GetZero() {
      return 0;
   }
};

関連項目

XML ドキュメント