创建一个cpp文件
~$ touch hello.cpp
用vim编辑器打开该文件
~$ vim hello.cpp
插入代码:i
保存并退出:先esc
:wq
不保存退出:先esc
:q!
进行编译 产生a.out文件
~$ g++ hello.cpp
输入以下命令运行程序 得到结果hello world
~$ ./a.out
~$ touch hello.cpp
~$ vim hello.cpp
插入代码:i
保存并退出:先esc
:wq
不保存退出:先esc
:q!
~$ g++ hello.cpp
~$ ./a.out