<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 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈