|
楼主 |
发表于 2003-11-27 17:08:56
|
显示全部楼层
代码如下:
#include
using namespace std;
class Sample
{
private:
int x,y;
public:
void setvalue(int x1,int y1);
void display();
};
void Sample::setvalue(int x1,int y1)
{
x=x1;y=y1;
}
void Sample::display()
{
cout<<"x="<<x<<",y=""<<y<<endl;
}
int main()
{
Sample acc;
acc.setvalue(3,33);
acc.display();
return 0;
}
编译错误报告如下:
[quote]D:/yzf/c/lx6.cpp:20:25: warning: multi-line string literals are deprecated
D:/yzf/c/lx6.cpp:20:25: missing terminating " character
D:/yzf/c/lx6.cpp:20:25: possible start of unterminated string literal
D:/yzf/c/lx6.cpp: In member function `void Sample::display()':
D:/yzf/c/lx6.cpp:20: parse error at end of input[/qutoe]
_________________ |
|