GCC test. C will compile a file named A. Out. ProgramGCC test. c-o test will compile a program named test. The-O parameter is used to specify the name of the program to be generated, if your program is placed under c: \, make sure that the DOS root directory is in the DOS window, that is, the DOS window must be displayed as c: \>, if it is not changed through the CD command. For example, I created a file in drive C. // File Code# Include <iostream> using namespace STD; int main () {cout <"Hello, world" ;}and save it as hello. CPP open the DOS window and find that the DOS window displays F: \> I typed C: And then press enter to return to the C drive and then type G ++ hello. after compilation of CPP-O hellothis example, A hello.exe file will be displayed in the C drive, and then type hello in the DOS window. The result is displayed. Next, let's talk about how to directly compile the program in Vim. First, install vim, after installation, add the following code to _ vimrc: "set the file browser directory to the current directory set bsdir = bufferset autochdir. In this way, VIM directly transfers the DOS directory to the edited directory, you can use: CD to check whether the directory is correct. Then write a program in vim and save a location. It is best to confirm this location, because if it changes frequently, it will cause errors, and then input the following command in VIM :! G ++ filename. cpp-O filename where filename is your saved file name and CPP is the program type. After the compilation is complete, type :! Filename. Or directly write the command: Make filename in vim.