Install Ubuntu on the Vmware virtual machine and compile and run C language programs
Install VMware
First download Vmware16
and then install, enter the installer
Click next
Accept the license terms and click Next
Change the installation path (do not have Chinese), keep the default settings and click Next
Uncheck these two
Click next directly
Click Install
Enter the key and click Finish
Create a new Ubuntu virtual machine
Enter VMware and click to create a new virtual machine
Click Customize Next
Next step
Install the operating system later, click Next
Select the Linux version as the guest operating system, select Ubuntu Next step
Change the installation path of the Ubuntu system Next step
Keep the default for the next step
Keep the default for the next
step. All subsequent steps keep the default for the next step.
Click Customize Hardware,
enter CD/DVD, select ISO image file, find Ubuntu ISO file, and click OK to finish
Install Ununtu
Click to turn on this virtual machine
Choose Chinese as language and install Ubuntu
If you choose chinese on the keyboard, the next step is the default
Choose the smallest installation.
Next
, choose shanghai for the region and keep the default,
then set the user name and password.
Click Install now and wait for it to be installed and restart it. You can restart for the first time and press Enter once.
Compile and run C language programs
Enter the virtual machine and enter the password
Skip all, the next step
Enter the desktop at this time,
right-click to open in the terminal
Execute sudo apt install vim
download vim tool
Execute sudo apt install gcc
download gcc compiler When
downloading, you need to enter a password, the password is not displayed in plain text
Execute vim hello.c
to create the C language program hello.c
Then enter the vim editor mode,
press i to enter the insert mode, and then write a C language program,
then press ESC to exit the insert mode
Then press Shift + : You can see a colon
at the bottom left. At this time, enter wq to save and exit
Next, use gcc to compile hello.c and press
gcc hello.c
Enter. You can see that there is one more a.out file, that is, the compiled file.
At this point, we execute the ./a.out
C language program successfully.