error C2017 C2001等求助
#include<iostream>int Double(int);
long Double(long);
float Double(float);
double Double(double);
using namespace std;
int main()
{
int myInt=6500;
long myLong=65000;
float myFloat=6.5F;
double myDouble=6.6e20;
int doubledInt;
long doubledLong;
float doubledFloat;
double doubledDouble;
cout<<"myInt: "<<myInt<<"\n";
cout<<"myLong: "<<myLong<<"\n";
cout<<"myFloat: "<<myFloat<<"\n";
cout<<"myDouble: "<<myDouble<<"\n";
doubledInt=Double(myInt);
doubledLong=Double(myLong);
doubledFloat=Double(myFloat);
doubledDouble=Double(myDouble);
cout<<"doubledInt: "<<doubledInt<<"\n";
cout<<"doubledLong: "<<doubledLong<<"\n";
cout<<"doubledFloat: "<<"doubledFloat<<"\n";
cout<<"doubledDouble: "<<"doubledDoule<<"\n";
return 0;
}
int Double(int original)
{
cout<<"In Double(int)\n";
return 2*original;
}
long Double(long original)
{
cout<<"In Double(long)\n";
return 2*original;
}
float Double(float original)
{
cout<<"In Double(float)\n";
return 2*original;
}
double Double(double original)
{
cout<<"In Double(double)\n";
return 2*original;
}
错误
--------------------Configuration: hello1 - Win32 Debug--------------------
Compiling...
hello1.cpp
C:\Program Files\Microsoft Visual Studio\MyProjects\hello1\hello1.cpp(34) : error C2017: illegal escape sequence
C:\Program Files\Microsoft Visual Studio\MyProjects\hello1\hello1.cpp(34) : error C2001: newline in constant
C:\Program Files\Microsoft Visual Studio\MyProjects\hello1\hello1.cpp(34) : error C2146: syntax error : missing ';' before identifier 'n'
C:\Program Files\Microsoft Visual Studio\MyProjects\hello1\hello1.cpp(34) : error C2065: 'n' : undeclared identifier
C:\Program Files\Microsoft Visual Studio\MyProjects\hello1\hello1.cpp(34) : error C2143: syntax error : missing ';' before 'string'
C:\Program Files\Microsoft Visual Studio\MyProjects\hello1\hello1.cpp(35) : error C2146: syntax error : missing ';' before identifier 'cout'
C:\Program Files\Microsoft Visual Studio\MyProjects\hello1\hello1.cpp(35) : error C2017: illegal escape sequence
C:\Program Files\Microsoft Visual Studio\MyProjects\hello1\hello1.cpp(35) : error C2001: newline in constant
C:\Program Files\Microsoft Visual Studio\MyProjects\hello1\hello1.cpp(35) : error C2146: syntax error : missing ';' before identifier 'n'
C:\Program Files\Microsoft Visual Studio\MyProjects\hello1\hello1.cpp(35) : error C2143: syntax error : missing ';' before 'string'
C:\Program Files\Microsoft Visual Studio\MyProjects\hello1\hello1.cpp(37) : error C2143: syntax error : missing ';' before 'return'
执行 cl.exe 时出错.
hello1.exe - 1 error(s), 0 warning(s)