| title |
<example> (Visual C++) | Microsoft Docs |
| ms.custom |
|
| ms.date |
11/04/2016 |
| ms.reviewer |
|
| ms.suite |
|
| ms.technology |
|
| ms.tgt_pltfrm |
|
| ms.topic |
article |
| f1_keywords |
|
| dev_langs |
|
| helpviewer_keywords |
<example> C++ XML tag |
example C++ XML tag |
|
| ms.assetid |
c821aaa7-7ea7-4bee-9922-6705ad57f877 |
| caps.latest.revision |
8 |
| author |
mikeblome |
| ms.author |
mblome |
| manager |
ghogen |
| translation.priority.ht |
cs-cz |
de-de |
es-es |
fr-fr |
it-it |
ja-jp |
ko-kr |
pl-pl |
pt-br |
ru-ru |
tr-tr |
zh-cn |
zh-tw |
|
The <example> tag lets you specify an example of how to use a method or other library member. Commonly, this would also involve use of the <code> tag.
<example>description</example>
description
A description of the code sample.
Remarks
Compile with /doc to process documentation comments to a file.
// 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 Documentation