I tried to compile the following code, but it fails:
#include <iostream>
int main(){
double conveter, temp=25;
conveter = (temp – 32.0) * 5.0/9.0;
std::cout<<conveter;
return 0;
}
with this error:
error C2146: syntax error : missing ')' before identifier '–'
Any advise please?
Wrong minus sign, type the minus sign again, then it works perfectly. Unicode...
You – -> me -
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With