編譯錯(cuò)誤error: stray ‘\343’in program的解決方法
更新時(shí)間:2013年07月25日 09:32:30 作者:
以下是對(duì)編譯錯(cuò)誤error: stray ‘\343’in program的解決方法進(jìn)行了詳細(xì)的分析介紹,如遇此問題的朋友們可以過來參考下
問題:
從網(wǎng)上拷貝了一段代碼,粘貼到自己寫的程序strcat_compare.c中,然后編譯gcc -o strcat_compare strcat_compare.c;
出現(xiàn)錯(cuò)誤如下:
復(fù)制代碼 代碼如下:
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$
運(yùn)行環(huán)境:ubuntu 11.10;
解決辦法:
1. 放狗搜,說可能程序本身的語法沒有問題,但是,出錯(cuò)行中包含不被識(shí)別的字符,比如空格的格式不對(duì);
2. 將程序中出錯(cuò)行前面的空格刪除,重新插入空格或tab鍵,重新編譯,錯(cuò)誤消失。
ok,問題解決。
相關(guān)文章
使用c++實(shí)現(xiàn)OpenCV繪制圓端矩形
這篇文章主要介紹了使用c++實(shí)現(xiàn)OpenCV繪制圓端矩形,其中著重的講解了OpenCV使用過程中需要注意的一些小細(xì)節(jié),避免浪費(fèi)大家在開發(fā)過程中浪費(fèi)多余的時(shí)間2021-08-08C++實(shí)現(xiàn)水仙花數(shù)判斷實(shí)例
大家好,本篇文章主要講的是C++實(shí)現(xiàn)水仙花數(shù)判斷實(shí)例,感興趣的同學(xué)趕快來看一看吧,對(duì)你有幫助的話記得收藏一下,方便下次瀏覽2022-01-01C++ LibCurl實(shí)現(xiàn)Web指紋識(shí)別功能
Web指紋識(shí)別是一種通過分析Web應(yīng)用程序的特征和元數(shù)據(jù),以確定應(yīng)用程序所使用的技術(shù)棧和配置的技術(shù),本文將通過C++中LibCurl庫實(shí)現(xiàn)簡(jiǎn)單是指紋識(shí)別功能,感興趣的可以了解下2023-11-11C語言基礎(chǔ)知識(shí)點(diǎn)解析(extern,static,typedef,const)
本篇文章是對(duì)C語言基礎(chǔ)知識(shí)點(diǎn)(extern,static,typedef,const)的用法進(jìn)行了詳細(xì)的分析介紹,需要的朋友可以過來參考下2013-10-10詳解windows下C/C++的內(nèi)存泄露檢測(cè)
C/C++由于其沒有垃圾回收機(jī)制,所以內(nèi)存的釋放一直以來都依靠于程序員的手工釋放,因此極其容易出現(xiàn)內(nèi)存泄露的問題,而在比較大的程序之中,查找內(nèi)存泄露是一件比較困難的事情,所以我們需要一些簡(jiǎn)便的方法來檢測(cè)內(nèi)存泄露,避免內(nèi)存泄露導(dǎo)致設(shè)備崩潰2021-06-06