I saw a one-person post on a forum today:
「 There was a strange problem recently,CodeThe Chinese annotations in enableProgramError !!!
Refer to the following code:
Int main (){
Int A = 0;
Int B = 0;
/** Parking source word */------ should be changed to "/* (space, or not empty) * parking source word (Space )*/"
A = 10;
B = 20;
/** End of comment */------ should be changed to "/* (space, or not empty) * end of comment (Space )*/"
Printf ("A = % d \ TB = % d", a, B );
Return 0;
}
The running result is: a = 0 B = 0
After analysis, it is found that the Intermediate Value assignment statement is treated as a comment and ignored.
Do you have this problem? How to explain it? How can this problem be avoided?
The compiling environment is VC ++ 6.0 .』
In fact, what I encountered was not fatal error c1071: unexpected end of file found in comment,
Check: When the comment contains Chinese characters, add a space at the end of the single line comment, and add a space before the multi-line comment...
Of course, it is best to use English for comments.
Because some special Chinese characters are processed into special escape sequences in some character sets, and the ending character in the GBK character set also contains the c Standard Escape Character 0x5c '\\', in these cases, an error occurs when the escape character is followed by */or a line comment, especially when compiling in a non-Chinese system. Modify as above.
The running result is: a = 0 B = 0 ------ the possible space is
/** Parking source word */
A = 10;
B = 20;
/** End comment (Space) */------ there is space here,/** stop ..... Do not run between bundles (spaces.
Printf ("A = % d \ TB = % d", a, B );
If it is/**/, no such problems will occur.
Http://topic.csdn.net/u/20100325/22/46c67761-38c8-4505-90bd-7c118791a298.html
Http://topic.csdn.net/u/20070627/21/82ab7370-5a98-4e4d-8ed4-da6ad0996b84.html? 310753027