|
|
我在Linux redhat 9下写了如下程序(是照书上的程序写的,就是想试试)
#include <iostream.h>
void main()
{
short int name[]={1,2,3,4,5,6,7,8,9,10};
short int *str=name;
int i=3;
cout << name << endl;
cout << *(str+i) << endl;
cout << *(name+i) << endl;
cout << &name << endl;
cout << name+i << endl;
cout << str+i << endl;
}
保存为.cpp文件
然后用gcc编译了一下
In file included from /usr/include/c++/3.2.2/backward/iostream.h:31,
from name.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.
name.cpp:3: `main' must return `int'
这是怎么回事阿?
另外我还想问一句 redhat 9 到底用不用再下载函数库了? |
|