3

我试图编译以下代码,但它失败了:

#include <iostream>

    int main(){
    double conveter, temp=25;

    conveter = (temp – 32.0) * 5.0/9.0;
    std::cout<<conveter;
        return 0;
    }

出现此错误:

错误 C2146:语法错误:在标识符 '–' 之前缺少 ')'

请问有什么建议吗?

4

2 回答 2

6
于 2013-11-05T12:07:05.920 回答
3

You've somehow ended up with a Unicode "en dash" character instead of an ASCII -.

Make sure you're using a plain text editor not a word processor; delete and retype the dash; and be careful where you copy and paste code from.

于 2013-11-05T12:11:34.993 回答