遇到error: stray ‘\357’ in program [solution.c]的解决办法

该错误是指源程序中有非法字符,需要将非法字符去掉。一般是由于coder使用中文输入法或者从别的地方直接复制粘贴代码造成的。
代码中出现了中文空格,中文引号, 各种中文标点符号都会出现,简单修改一下就OK了。

解决方法:

1.把出错行的空格及其前后空格删掉重新打一下试试。

2.把明显和其他标点符号颜色不同的改掉。(大部分编译器都有颜色识别)

3.直接全部重打。

版权声明:

本文为CSDN博主「AboutYoui」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接

Main.cc:37:17: error: stray ‘\342’ in program result =“Yes”; ^ Main.cc:37:18: error: stray ‘\200’ in program result =“Yes”; ^ Main.cc:37:19: error: stray ‘\234’ in program result =“Yes”; ^ Main.cc:37:23: error: stray ‘\342’ in program result =“Yes”; ^ Main.cc:37:24: error: stray ‘\200’ in program result =“Yes”; ^ Main.cc:37:25: error: stray ‘\235’ in program result =“Yes”; ^ Main.cc:39:17: error: stray ‘\342’ in program result =“No”; ^ Main.cc:39:18: error: stray ‘\200’ in program result =“No”; ^ Main.cc:39:19: error: stray ‘\234’ in program result =“No”; ^ Main.cc:39:22: error: stray ‘\342’ in program result =“No”; ^ Main.cc:39:23: error: stray ‘\200’ in program result =“No”; ^ Main.cc:39:24: error: stray ‘\235’ in program result =“No”; ^ Main.cc: In function ‘std::__cxx11::string solution(std::__cxx11::string, std::__cxx11::string)’: Main.cc:17:20: error: ‘strlen’ was not declared in this scope int tStrLenW = strlen(words); ^~~~~~ Main.cc:17:20: note: suggested alternative: ‘mbrlen’ int tStrLenW = strlen(words); ^~~~~~ mbrlen Main.cc:27:13: error: ‘strcat’ was not declared in this scope strcat(pCharText, &msg[tMsgFlag]); ^~~~~~ Main.cc:27:13: note: suggested alternative: ‘struct’ strcat(pCharText, &msg[tMsgFlag]); ^~~~~~ struct Main.cc:36:33: error: cannot convert ‘std::__cxx11::string {aka std::__cxx11::basic_string}’ to ‘const char*’ for argument ‘2’ to ‘int strcasecmp(const char*, const char*)’ if(strcasecmp(pCharText, msg) == 0) ^ Main.cc:37:20: error: ‘Yes’ was not declared in this scope result =“Yes”; ^~~ Main.cc:39:20: error: ‘No’ was not declared in this scope result =“No”; ^
06-06
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值