Home > Posts > Defining regions in C/C++ for outlining (code folding) at Visual Studio code editor

Defining regions in C/C++ for outlining (code folding) at Visual Studio code editor

Many Visual Basic.net and C# programmers have grown to like the #Region keyword which allows one to define a foldable region of code giving some text for it (name) that will be displayed in the source code editor when the region is folded (collapsed). In case you’re one of them too (like me) and miss it in Visual C++, you should look up (at the link provided below) the syntax:

#pragma region Name

#pragma endregion Optional Comment (usually same as Name)

Advertisements
Categories: Posts
  1. 2010/10/20 at 13:52

    thanks to the anonymous reader who pointed out that I had placed an extra space between “end” and “region” by mistake

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: