centos下编译c++

时间:2014-05-25 22:19:17   收藏:0   阅读:468

前提条件是已经安装了g++

要是没有安装,就

yum install g++

1,编写Hello.cpp
1>vim
2>
#include <stdio>
int main()
{
  printf("Hello,the world!");
  return 0;
}
3>
:w hello.cpp
2,退出vim !q
3,编译
#g++ -o hello hello.cpp
#./hello
就可以看到屏幕显示:
Hello,the world.
成功了,呵呵!

centos下编译c++,布布扣,bubuko.com

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!