木其网络科技专业程序员代写http://www.xmsydw.com
程序员学历擅长经验网店链接
apenny硕士ASP.NET PHP 电子 通信设计 图像 编程 网络5年进入店铺
zheng_qianqian本科C语言 C++面向对象 Java3年进入店铺
guoguanl本科Java Web项目 JSP Hibernate Struts Mysql4年进入店铺

编译错误error: stray ‘\343’ in program的解决

问题:

从网上拷贝了一段代码,粘贴到自己写的程序strcat_compare.c中,然后编译gcc -o strcat_compare strcat_compare.c;

出现错误如下:

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$

运行环境:ubuntu 11.10;


解决办法:

1. 放狗搜,说可能程序本身的语法没有问题,但是,出错行中包含不被识别的字符,比如空格的格式不对;

2. 将程序中出错行前面的空格删除,重新插入空格或tab键,重新编译,错误消失。


问题解决。



posted @ 2013-03-28 16:07  C语言程序  阅读(1792)  评论(0编辑  收藏  举报
木其网络科技专业程序员代写http://www.xmsydw.com
程序员学历擅长经验网店链接
apenny硕士ASP.NET PHP 电子 通信设计 图像 编程 网络5年进入店铺
zheng_qianqian本科C语言 C++面向对象 Java3年进入店铺
guoguanl本科Java Web项目 JSP Hibernate Struts Mysql4年进入店铺