栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > C/C++/C#

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

C/C++/C# 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

编译错误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键,重新编译,错误消失。
ok,问题解决。

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/66362.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号