LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 586|回复: 0

新手请教问题

[复制链接]
发表于 2005-4-6 14:37:09 | 显示全部楼层 |阅读模式
我在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 到底用不用再下载函数库了?
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表