从网页上拷贝了一段程序,在gcc下编译,发现很多错误,都是如下类型:
pthread_cond.c: In function ‘main’:
pthread_cond.c:62: error: stray ‘\343’ in program
pthread_cond.c:62: error: stray ‘\200’ in program
pthread_cond.c:62: error: stray ‘\200’ in program
pthread_cond.c:62: error: stray ‘\343’ in program
pthread_cond.c:62: error: stray ‘\200’ in program
pthread_cond.c:62: error: stray ‘\200’ in program
找了很久,硬是没有找到程序中有语法错误。刚开始以为是标点符号不对。然后改标点符号。重新编译,还是这个错误。没办法,网上查资料吧。
有的说是字符编码的问题!!如果真是字符编码的问题,那没办法,只能自己重新敲一遍咯~
继续网上查资料。
看到一位兄弟的博客,恍然大悟!原来,是中文空格的问题!!