错误:stray'\210'在C ++中的程序 [英] error: stray ‘\210’ in program in C++

查看:454
本文介绍了错误:stray'\210'在C ++中的程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


可能重复:

Possible Duplicate:
Xcode gives 3 syntax errors dealing with Stray ‘\342’ in program





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函数取3个值并返回最小值。这些错误来自哪里以及如何清除它们?

Where mGamma is defined as vector<vector<double> > mGamma and min function take 3 values and returns the minimum .Where do these error come from and how to get rid of them ?

推荐答案

该错误消息意味着文件中的字节与编译器理解的任何字符不对应,因此它打印出其八进制值,并告诉您这不可能是有效的

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.

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

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