Linux Learning 2-VI/GCC

Source: Internet
Author: User

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

  

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.