|
在RedHat9下编写了一个很简单的C++程序,在使用cc编译的时候出现这样的问题
In file included from /usr/include/c++/3.2.2/backward/iostream.h:31,
from ch11_1.cpp:1:
/usr/include/c++/3.2.2/backward/backward_warning.h:32:2: warning: #warning This
file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples
include substituting the <X> header for the <X.h> header for C++ includes, or <sstream> instead of the deprecated header <strstream.h>. To disable this warning
use -Wno-deprecated.
ch11_1.cpp:20: `main' must return `int'
程序是这样的:
#include<iostream.h>
class Tdate{
public:
void Set(int m, int d, int y){
month=m; day=d; year=y;
}
void Print(){
cout<<month<<"/"<<day<<"/"<<year<<endl;
}
private:
int month;
int day;
int year;
};
void main()
{
Tdate a;
a.Set(2,4,2004);
a.Print();
}
谢谢大家! |
|