C++小程序编译出错,不知哪里错了,请高手进入
程序代码:
#include <iostream> using namespace std; class Sample ; class Sample { private: int data; Sample( ){data=10;} public: Sample(int d){data=d;} operator int( ){return data;} };--------------------Configuration: training - Win32 Debug--------------------
Compiling...
training.cpp
D:\Program Files\Microsoft Visual Studio\MyProjects\myproject\training.cpp(12) : error C2018: unknown character '0xa1'
D:\Program Files\Microsoft Visual Studio\MyProjects\myproject\training.cpp(12) : error C2018: unknown character '0xa1'
D:\Program Files\Microsoft Visual Studio\MyProjects\myproject\training.cpp(12) : error C2018: unknown character '0xa1'
D:\Program Files\Microsoft Visual Studio\MyProjects\myproject\training.cpp(12) : error C2018: unknown character '0xa1'
D:\Program Files\Microsoft Visual Studio\MyProjects\myproject\training.cpp(14) : error C2018: unknown character '0xa1'
D:\Program Files\Microsoft Visual Studio\MyProjects\myproject\training.cpp(14) : error C2018: unknown character '0xa1'
D:\Program Files\Microsoft Visual Studio\MyProjects\myproject\training.cpp(14) : error C2018: unknown character '0xa1'
D:\Program Files\Microsoft Visual Studio\MyProjects\myproject\training.cpp(14) : error C2018: unknown character '0xa1'
D:\Program Files\Microsoft Visual Studio\MyProjects\myproject\training.cpp(18) : error C2018: unknown character '0xa1'
D:\Program Files\Microsoft Visual Studio\MyProjects\myproject\training.cpp(18) : error C2018: unknown character '0xa1'
D:\Program Files\Microsoft Visual Studio\MyProjects\myproject\training.cpp(18) : error C2018: unknown character '0xa1'
D:\Program Files\Microsoft Visual Studio\MyProjects\myproject\training.cpp(18) : error C2018: unknown character '0xa1'
D:\Program Files\Microsoft Visual Studio\MyProjects\myproject\training.cpp(20) : error C2018: unknown character '0xa1'
D:\Program Files\Microsoft Visual Studio\MyProjects\myproject\training.cpp(20) : error C2018: unknown character '0xa1'
D:\Program Files\Microsoft Visual Studio\MyProjects\myproject\training.cpp(20) : error C2018: unknown character '0xa1'
D:\Program Files\Microsoft Visual Studio\MyProjects\myproject\training.cpp(20) : error C2018: unknown character '0xa1'
执行 cl.exe 时出错.
training.obj - 1 error(s), 0 warning(s)