web123456

Using vim to write and run C and C++ programs under Linux (taking hello world as an example)

vim writes C and C++ program procedures (taking hello world as an example):
1、vim /。
create/File and enter the vim interface;
2、Type i to enter input mode
3. Write/program.
4、Press the Esc key first to exit the input modeThen, press Shift+: to enter command modeEnter wq, save and exit
5. Compilation/。
5.1. For C program:gcc Then compile;
5.2. For C++ programs:g++ Compilable. After compilation, all generated executable files;
6. Type the command"./", run the program.
7. Displaying "hello world" on Terminal is successful.