How can you install C++ on Ubuntu

How can you install C++ on Ubuntu

There are 2 methods through which you can install C++
Command-line method.
Do this on your terminal:
sudo apt-get update
to update your package list with the most recent version of g++ enter you password and press Return and then,
sudo apt-get install g++
to install g++.
Method 2 : UI method
You could also install it from the Software Center. Type "Software Center" on the dash and then type g++ in the search bar after that software center opens up with suggestions and then click on install and enter your password.

another methode :

Install compiler(s)
  • Update
    # apt-get update
  • C and C++ and make etc.
    # apt-get install build-essential
  • Fortran
    # apt-get install gfortran g77
To edit source code
use any text editor.
From the graphical user interface.
From the command line use vim:
# vim main.cpp
To compile
# g++ main.cpp -o main
Hope it Helps!

>> Also you can read: What should you do if you lost all your data in ubuntu

ليست هناك تعليقات