|
#include <iostream>
using namespace std;
class Printer
{
private:
int Serial_Number;
public:
void Hello()
{
char name[10];
cout <<"please input your name :" <<endl;
cin>>name;
cout<<"hello c++"<<endl;
cout<<"my name is"<<name<<"."<<endl;
}
}
int main(void)
{
Printer My_Printer;
My_Printer.Hello();
return 0;
}
---------------------------------
编译提示 :
[root@xunil ~]# g++ hello.cpp
hello.cpp:17: error: new types may not be defined in a return type
hello.cpp:17: note: (perhaps a semicolon is missing after the definition of ‘Printer’)
hello.cpp:17: error: two or more data types in declaration of ‘main’
hello.cpp:17: error: ‘::main’ must return ‘int’
难道 return 0,不是返回 整数吗?大家帮我指点一下 ! |
|