user-0 提问: 这个算是VC编译器的BUG吗？

回复:
user: user-1
content: 偶遇到类似问题都是用 “每次用/*...*/注释掉不同部分再重新编译，直到定位到具体语法出错的位置。” 的方法解决的。

user: user-1
content: Trigraphs The source character set of C source programs is contained within the 7-bit ASCII character set but is a superset of the ISO 646-1983 Invariant Code Set. Trigraph sequences allow C programs to be written using only the ISO (International Standards Organization) Invariant Code Set. Trigraphs are sequences of three characters (introduced by two consecutive question marks) that the compiler replaces with their corresponding punctuation characters. You can use trigraphs in C source files with a character set that does not contain convenient graphic representations for some punctuation characters.   Table 1.1 shows the nine trigraph sequences. All occurrences in a source file of the punctuation characters in the first column are replaced with the corresponding character in the second column.   Table 1.1   Trigraph Sequences  Trigraph Punctuation Character  ??= #  ??( [  ??/ \  ??) ]  ??’ ^  ??< {  ??!  |  ??> }  ??-  ~    A trigraph is always treated as a single source character. The translation of trigraphs takes place in the firsttranslation phase, before the recognition of escape characters in string literals and character constants. Only the nine trigraphs shown in Table 1.1 are recognized. All other character sequences are left untranslated.   The character escape sequence, \?, prevents the misinterpretation of trigraph-like character sequences. (For information about escape sequences, see Escape Sequences.) For example, if you attempt to print the string What??! with this printf statement  printf( "What??!\n" );  the string printed is What| because ??! is a trigraph sequence that is replaced with the | character. Write the statement as follows to correctly print the string:  printf( "What?\?!\n" );  In this printf statement, a backslash escape character in front of the second question mark prevents the misinterpretation of ??! as a trigraph.

user: user-1
content: 推荐使用WinHex软件查看硬盘或文件或内存中的原始字节内容。

user: user-2
content: 没遇到过啊。。。。。奇怪啊。。

user: user-3
content: 一般 if    else  注释向下面那样  //注释 if（）//注释     。。。。         else   //注释    。。。。  你这个注释方式有点奇怪

user: user-3
content: 引用 7 楼 zhaokai115 的回复:莫非是trigraph??  if (cond) { } //??/ else {    // executing always ... } 有可能是这种情况。

user: user-1
content: 重建所有

user: user-0
content: 引用 14 楼 zhao4zhong1 的回复:偶遇到类似问题都是用 “每次用/*...*/注释掉不同部分再重新编译，直到定位到具体语法出错的位置。” 的方法解决的。 我确实这样做了，一行一行的进行，最后才发现是else的问题，不论当时程序是否为正确的，但是while下面就一个if和else，使用了if(1);发现else执行了，去掉注释后，运行就正确了，有可能是字符编码的问题。

user: user-0
content: 引用 6 楼 max_min_ 的回复:这说的，贴上你的源代码就知道其中原委了的 任何一个编译器都不会出现这么明显的bug的，更不用说vc了！ 应该是字符码的问题，原码如下  //闈為€掑綊鍚庣画閬嶅巻 Status NotRecursionAft(btNode *T) { 	ElemType elem;SqStack s; 	InitStack(&s); 	elem.NodePointer = T; 	while(elem.NodePointer || !StackEmpty(&s)) 	{ 		if(elem.NodePointer) 		{ 			elem.tag = 1; 			Push(&s,elem); 			//缁х画鍚戝乏閬嶅巻瀛愭爲 			elem.NodePointer = elem.NodePointer->lchild; 		} 		//杩欓噷鏄敞閲婁唬鐮佺殑鍦版柟 		else 		{ 			//灏嗘爤椤跺厓绱犵殑tag鍊煎姞1 			(s.top - 1)->tag++; 			GetTop(&s,&elem); 			while(elem.tag == 3) 			{ 				Pop(&s,&elem); 				printf("%c ",elem.NodePointer->data); 				//灏嗘爤椤跺厓绱犺嚜澧? 				(s.top - 1)->tag++; 				if(!GetTop(&s,&elem)) 					break; 			} 			if(GetTop(&s,&elem)) 				elem.NodePointer = elem.NodePointer->rchild; 			else 				elem.NodePointer = NULL; 		} 	} }  在else前面注释了一行，程序确实出现了问题，但是我今天测试代码又像昨天那样，没有出现问题。。

user: user-4
content: 如果你的注释是中文的，有的编译器会将中文的双字节分开读取，造成 /* */ 的“提前”匹配，这就是有些编程规则中要求注释必须用 标准ascii 的原因

user: user-5
content: 你加的注释估计是宽字符，因为文件编码支持问题，换行符被编译器看成宽字符的一部分（比如当成半个汉字），导致else行被当做注释的一部分而忽略掉。在一些编译器中遇到过。

user: user-6
content: 莫非是trigraph??  if (cond) { } //??/ else {    // executing always ... }

user: user-7
content: 这说的，贴上你的源代码就知道其中原委了的 任何一个编译器都不会出现这么明显的bug的，更不用说vc了！

user: user-5
content: 文件编码的问题，有一些老的编译器不支持某些编码的文件，而VC6毕竟相当古老了。

user: user-8
content: 最好能帖上C++源码和调试时的汇编码

user: user-0
content: 引用 2 楼 czarten 的回复:[quote=引用 1 楼 czarten 的回复:] 是不是乱码影响到了对换行的判断  如果是/**/呢？[/quote]  有可能，但是我在VC中看见的代码，确实是注释还是注释，颜色区分相当明显，虽然同样是乱码，我在Eclipse上(Java)却没有出现过这样的情况。

user: user-9
content: 引用 1 楼 czarten 的回复:是不是乱码影响到了对换行的判断  如果是/**/呢？

user: user-9
content: 是不是乱码影响到了对换行的判断