许多杂散错误-“错误:C ++程序中杂散‘\ 210’" [英] Lots of stray errors - "error: stray ‘\210’ in program in C++"

查看:86
本文介绍了许多杂散错误-“错误:C ++程序中杂散‘\ 210’"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:
Xcode给出了处理Stray'\的3种语法错误程序中的342'

if(mGamma[i−1][j] == min(mGamma[i − 1][j], mGamma[i][j − 1], mGamma[i − 1][j − 1]))

上面的行给了我这些错误:

The line above gives me these errors:

/home/rajat/iCub/tutorials/src/vectordtw.h:91:3: error: stray ‘\210’ in program
/home/rajat/iCub/tutorials/src/vectordtw.h:91:3: error: stray ‘\222’ in program
/home/rajat/iCub/tutorials/src/vectordtw.h:91:3: error: stray ‘\342’ in program
/home/rajat/iCub/tutorials/src/vectordtw.h:91:3: error: stray ‘\210’ in program
/home/rajat/iCub/tutorials/src/vectordtw.h:91:3: error: stray ‘\222’ in program
/home/rajat/iCub/tutorials/src/vectordtw.h:91:3: error: stray ‘\342’ in program
/home/rajat/iCub/tutorials/src/vectordtw.h:91:3: error: stray ‘\210’ in program
/home/rajat/iCub/tutorials/src/vectordtw.h:91:3: error: stray ‘\222’ in program
/home/rajat/iCub/tutorials/src/vectordtw.h:91:3: error: stray ‘\342’ in program
/home/rajat/iCub/tutorials/src/vectordtw.h:91:3: error: stray ‘\210’ in program
/home/rajat/iCub/tutorials/src/vectordtw.h:91:3: error: stray ‘\222’ in program
/home/rajat/iCub/tutorials/src/vectordtw.h:91:3: error: stray ‘\342’ in program
/home/rajat/iCub/tutorials/src/vectordtw.h:91:3: error: stray ‘\210’ in program
/home/rajat/iCub/tutorials/src/vectordtw.h:91:3: error: stray ‘\222’ in program

其中mGamma定义为 vector< vector< double>>mGamma min 函数采用三个值并返回最小值.这些错误从何而来,如何消除它们?

Where mGamma is defined as vector<vector<double> > mGamma and the min function takes three values and returns the minimum. Where do these errors come from, and how do I get rid of them?

推荐答案

该错误消息表示文件中的某些字节与编译器可以理解的任何字符都不对应,因此它将打印出它们的八进制值并告诉您这可能不是有效的C(++)程序.

That error message means that there are bytes in the file that don't correspond to any character the compiler understands, so it's printing out their octal values and telling you that this can't possibly be a valid C(++) program.

您显示的字节序列似乎是U + 2212 MINUS SIGN的UTF-8编码.尽管这是在适当的" Unicode文本中用作减号的适当的"字符(这就是为什么它以这种方式从PDF复制出来的原因),但C系列的基本源字符集"仍然以ASCII为中心.您需要将每个减号替换为U + 002D HYPHEN-MINUS.像通常键入的那样,在每个符号上键入一个负号应该可以解决问题.

The byte sequence you show appears to be the UTF-8 encoding of U+2212 MINUS SIGN. Despite this being the "appropriate" character to use for a minus sign in "proper" Unicode text (which is why it's copying out of a PDF that way), the C family's "basic source character set" remains ASCII-centric; you need to replace each of those minus signs with U+002D HYPHEN-MINUS. Typing over each with a minus sign, as you normally would type it, should do the trick.

这篇关于许多杂散错误-“错误:C ++程序中杂散‘\ 210’"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆