There is a text () macro in VC, And the execution status is as follows:
- Text ("ABC")// The result is l "ABC"
- Text (XYZ)// The result is lxyz.
This is defined in the header file.
- # DEFINE _ text (quote) _ text # quote
What are the roles of these two well numbers? By viewing msdn, we found that they are used to link the strings inside and outside brackets.
This feature can solve the current small problems
For exampleProgramThe engineer is responsible for writing a program module. His head asks him to add a prefix before each variable name to identify which module is defined, the prefix he obtained is "company _ big department _ small department _ big group _ Three _". If each variable is prefixed with such a long prefix, it will be too difficult to write, second, it is also prone to errors, and the variable name is not like a string, so you can split and combine it at will. at this time, we can use two well numbers to easily solve the problem.
CodeAs follows:
-
- # Include <iostream>
-
- UsingSpacename STD;
-
- # Define z (nvar) company _ big departments _ Small departments _ big group _ zhangsan _ # nvar
-
- VoidMain ()
-
- {
-
- // Int company _ big department _ small department _ big group _ Zhang san_1 = 10;
-
- IntZ (1) = 10;
-
- IntZ (2) = 20;
-
- IntZ (3) = 30;
-
-
- // Int max = z (1) + company _ big departments _ Small departments _ big group _ Michael _ 2 + z (3 );
- IntMax = z (1) + z (2) + z (3 );
-
- Cout <max <Endl;
-
- }
The code is implemented in WINXP and vc2005.