| description | Learn more about the region and endregion pragma directives in Microsoft C/C++ | ||||
|---|---|---|---|---|---|
| title | region and endregion pragma | ||||
| ms.date | 01/22/2021 | ||||
| f1_keywords |
|
||||
| helpviewer_keywords |
|
||||
| no-loc |
|
#pragma region lets you specify a block of code that you can expand or collapse when using the outlining feature of the Visual Studio editor.
#pragma regionname
#pragma endregioncomment
comment
(Optional) A comment to display in the code editor.
name
(Optional) The name of the region. This name displays in the code editor.
#pragma endregion marks the end of a #pragma region block.
A #pragma region block must be terminated by a #pragma endregion directive.
// pragma_directives_region.cpp
#pragma region Region_1
void Test() {}
void Test2() {}
void Test3() {}
#pragma endregion Region_1
int main() {}