<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;
}
};
另請參閱
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應