error: stray ‘\302’ in program
For those who have already encountered this error “error: stray ‘\302’ in program” or something similar while compiling a program in C :
fool@localhost:~$ gcc -o hello_world hello_world.c
hello_world.c: In function ‘main’ :
hello_world.c:5: error: stray ‘\302’ in program
hello_world.c:5: error: stray ‘\304’ in program
Either you have to remove the entire line (here line 5), or you just have to remove some trailing characters. Sometimes, while writing into a text editor, some non-ASCII characters are inserted accidentally.
主要产生的原因就是全角字符和半角字符在编程时候的使用错误。注意:
编程的时候标点符号只能使用半角的,不能使用全角的。注意.以下是网上找的一片文章:
看看吧。
A 什么是全角和半角? (1)全角--指一个字符占用两个标准字符位置。 汉字字符和规定了全角的英文字符及国标