VS, using preprocessing directives #pragma region free folding code

Source: Internet
Author: User
Before the KE read and save function, unexpectedly appears for{for{if{for{switch{if{for{}}}}}} such complex nesting, the code looks very faint. In this case, it is necessary to fold the code so that the logical relationship can be easily and geographically clear. Auto-collapse markup for Visual Studio, the default is to have the ' + ' number only in the function, and if,for,switch these places are not. Can be opened in this way: tool--> option--> text editor-->c/c++--> formatting--> outline statement block--> set to true manually adding fold marks The above method is simple and convenient, But there are too many folding tags to look dizzy, so we can also manually add, can be folded anywhere. Add the #pragma region ABC and #pragma endregion ABC separately to the beginning and end of the collapsed area (ABC modifiable)
Pragma_directives_region.cpp
#pragma region region_1
void Test () {} void
Test2 () {}
void Test3 () {}< c6/> #pragma endregion region_1

int main () {}
Msdn:https://technet.microsoft.com/zh-cn/exchange/b6xkz944#pragma preprocessing directives more usage: http://baike.baidu.com/subview/ 1451188/1451188.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.