第一个c++程序
001、
[root@pc1 test01]# ls test.cpp [root@pc1 test01]# cat test.cpp ## 第一个c++程序 #include <iostream> using namespace std; int main() { cout << "hello world!" << endl; return 0; } [root@pc1 test01]# g++ test.cpp ## 编译 [root@pc1 test01]# ls ## 查看编译结果 a.out test.cpp [root@pc1 test01]# ./a.out ## 执行可执行程序 hello world!
。