Today, I briefly studied the use of VI and gcc/g++.
First is the first time with the root Super Admin user login to the Linux system, because the Ubuntu system first login can only be ordinary users, but a lot of things need to use root permissions, so today specifically on the Internet search how to use the root user, first log in with ordinary users, and then input sudo passwd root, you can set the root password, in addition, with the SU Command + user name, you can switch users at will. OK, now let's talk about what we learned today.
VI is the Linux system comes with the editor, but Ubuntu does not seem complete, to reinstall, enter the command, Apt-get install VIM. (without installation, after entering with VI, press I cannot enter insert edit code)
GCC comes in Ubuntu, but g++ to reinstall!! Enter Apt-get install g++.
At this point, VI and gcc/g++ can be used normally!
I use VI helloworld.cpp to create a new C + + program, and open, edit, and compile with g++. The output helloworld! can be run in the following 2 steps
1.g++ Helloworld.cpp
2../a.out
Or g++-o helloword.exe helloworld.cpp,./helloworld.exe