共用方式為


<example> 檔標籤

標記 <example> 可讓您指定如何使用方法或其他程式庫成員的範例。 通常,使用此標籤也會牽涉到 <code> 標記。

語法

/// <example>description</example>

參數

description
程式碼範例的描述。

備註

使用 /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 檔