【发布时间】:2012-11-05 00:39:27
【问题描述】:
可能重复:
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]))
上面的行给了我这些错误:
/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 函数采用三个值并返回最小值。这些错误是从哪里来的,我该如何消除它们?
【问题讨论】:
-
你用的是什么文本编辑器?
-
我在使用 Vim 时遇到过这些问题
-
我正在使用 gedit,但我粘贴了 pdf 中的伪代码,然后将其更改为 C++
-
那么这就是问题所在。然后您可能必须键入每一行。从 PDF 复制将无济于事(再一次,存在编码问题)。也许 PDF 文本使用了 gcc 不支持的不同编码?
-
问题字符是每个减号,所以是的,它与@JeremiahWillcock 发现的早期问题相同。
标签: c++