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