編譯錯誤error: stray ‘\343’in program的解決方法
更新時間:2013年07月25日 09:32:30 作者:
以下是對編譯錯誤error: stray ‘\343’in program的解決方法進行了詳細的分析介紹,如遇此問題的朋友們可以過來參考下
問題:
從網(wǎng)上拷貝了一段代碼,粘貼到自己寫的程序strcat_compare.c中,然后編譯gcc -o strcat_compare strcat_compare.c;
出現(xiàn)錯誤如下:
復制代碼 代碼如下:
avid@ubuntu:~/wrk/tmp$ gcc -o strcat_compare strcat_compare.c
strcat_compare.c: In function ‘main':
strcat_compare.c:28:1: error: stray ‘\343' in program
strcat_compare.c:28:1: error: stray ‘\200' in program
strcat_compare.c:28:1: error: stray ‘\200' in program
strcat_compare.c:28:1: error: stray ‘\343' in program
strcat_compare.c:28:1: error: stray ‘\200' in program
strcat_compare.c:28:1: error: stray ‘\200' in program
strcat_compare.c:30:1: error: stray ‘\343' in program
strcat_compare.c:30:1: error: stray ‘\200' in program
strcat_compare.c:30:1: error: stray ‘\200' in program
strcat_compare.c:30:1: error: stray ‘\343' in program
strcat_compare.c:30:1: error: stray ‘\200' in program
strcat_compare.c:30:1: error: stray ‘\200' in program
strcat_compare.c:32:1: error: stray ‘\343' in program
strcat_compare.c:32:1: error: stray ‘\200' in program
strcat_compare.c:32:1: error: stray ‘\200' in program
strcat_compare.c:32:1: error: stray ‘\343' in program
strcat_compare.c:32:1: error: stray ‘\200' in program
strcat_compare.c:32:1: error: stray ‘\200' in program
david@ubuntu:~/wrk/tmp$
運行環(huán)境:ubuntu 11.10;
解決辦法:
1. 放狗搜,說可能程序本身的語法沒有問題,但是,出錯行中包含不被識別的字符,比如空格的格式不對;
2. 將程序中出錯行前面的空格刪除,重新插入空格或tab鍵,重新編譯,錯誤消失。
ok,問題解決。
相關(guān)文章
C語言基礎(chǔ)知識點解析(extern,static,typedef,const)
本篇文章是對C語言基礎(chǔ)知識點(extern,static,typedef,const)的用法進行了詳細的分析介紹,需要的朋友可以過來參考下2013-10-10