The variable name of c ++'s interest subverts Visual Studio of all textbooks, and subverts Visual Studio.

Source: Internet
Author: User

The variable name of c ++'s interest subverts Visual Studio of all textbooks, and subverts Visual Studio.

GCC does not participate in this fun.

All the tutorials will tell you that the variable name, class name, and function name of c ++ should be a combination of letters, numbers, and underscores starting with a letter or underscore, like this:

Int _ abc123;

In fact, Visual Studio does not comply with this specification, but is broader. These can be:

# Include <stdio. h> # include <tchar. h> # define if # define prints printf # define returns return # define start {# define end} # define main function _ tmain # define integer int/pure Chinese C ++ Program design an integer main function (integer parameter, _ TCHAR * argv []) start if (1> 0) print ("1"); print ("Fyter print % d", parameter); Return 0; End

This is a program that can be compiled in.

For such a compiler, the variable name should be:

Non-visual characters, such as tab, \ n, \ r...

The operator is not allowed, such as =-+ */...

Keywords, such as const, int, class...

Any character other

 

Although such compilers are not standardized, they are related to Microsoft's culture-globalization. The variable name is intended to express a meaning, So What text should be the user's right.

The test function of VS can display the namespace, class name, and function name in the unit test. I use a lot of Chinese characters to describe it intuitively.

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.