What is C++?

C++ is an object-oriented-programming language ,one of the first of its kind ,and it had a very huge impact in the era of the computer age.It is still used in making games ,desktop applications and has several libraries which make it useful for competitive programming as well.


It was founded by Bjarne Stroustrup in the late 1980's


Installing C++ :
To get started with c++ , you have to install :
  • a Text Editor
  • a compiler

  • You can use all this separately or use an IDE (Intgerated Development Environment) which has all this pre-installed. The most popular ones are :

  • Visual-Studio Code
  • CodeBlocks
  • Visual-Studio

  • On Windows:
    STEP 1:
    Copy and paste the above lines in powershell .Do it as an administrator and press Y to confirm the installation
    powershell
    STEP 2:
    Now that we have installed choco , next step would be to install Visual Studio Code.It is a very powerful text-editor by Microsoft .We will install it using choco itself . Copy and Paste the following in powershell as administrator :
    STEP 3:
    Next step is to install the c++ compiler - mingw and this can be done by clicking and installing it. Tick all ✔️ of them by right clicking and select mark for installation wait for them to be installed . powershell
    STEP 4:
    Next step is to tell your computer that mingw is installed on your computer , you can do this by setting an Environment Variable . Go to Advanced System Settings and set a new Environment variable :
    Systemsettings
    ➡️ Set the new Environment Variable as the location of the mingw bin file which is usually
    C:\MinGW\bin
    Copy and paste this as the enviroment variable and click on OK
    STEP 5 :
    Next step is to run your c++ program : open visual studio code and open a new terminal by clicking on terminal or by pressing
    ctrl+shift+`
    on your keyboard . Now type the following in the terminal:
    1. mkdir + name of directory : to create a directory (eg : mkdir c++)
    2. cd + name of directory : {name of the directory you had created} (eg: cd c++)
    3. code . : {to open a vs code window with that file}
    Now all you have to do is start writing your c++ program ! and compile it by clicking on run without debugging or by typing
    ctrl+f5
    .
    On Linux :
    Installing c++ is pretty easy as most of it is done through the terminal.You can do this by first typing:
    sudo apt update && sudo apt upgrade -y
    : This will update and upgrade the system
    Then type the following to install the build essentials and the c++ compiler - g++ and c++ debugger - gdb
    sudo apt install build-essential gdb g++
    : This will install g++ and gdb and the build essentials
    Then type the following to install programs to download vscode on the terminal itself :
    sudo apt install software-properties-common apt-transport-https wget
    wget -q https://packages.microsoft.com/keys/microsoft.asc -O- | sudo apt-key add -
    sudo add-apt-repository "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main"
    Then type the following to install visual studio code :
    sudo apt update && sudo apt install code