C++ Installation

In this tutorial you will learn about the C++ Installation and its application with practical example.

C++ Installation

Installing C++ In Windows

In order to set up a C++ Programming environment you need to have C++ Compiler installed on your system, so if you don’t have it installed, check the following instruction to get C++ installation. If you’ve already have installed C++ in your system, you can skip this part.

Step 1:- Download the turbo C++ online from any of the safe websites or directly from the link given below –

Download turbo C++

Step 2:- Create a folder “turbo” in c:\ Drive and extract the tc3.zip file in c:\turboc directory.

Step 3:- Now, start the installation by double-clicking the INSTALL Application file in the c:\turboc directory.

Step 4:- Follow the installation wizard to install Turbo C++. Press “Enter” here to start the installation.

cpp-installation-11

Step 5:- Now, change or select installation directory to c:\ and press “Enter”

cpp-installation-2

Step 6:- Now, select the c:\turboc directory that we have created containing required installation files, and press “Enter”

cpp-installation-3

Step 7:- Now, select Start Installation using the down arrow key and then press “Enter”.

cpp-installation-4

Step 8:- Installation is done, press enters to read the documentation and close the installation wizard.

cpp-installation-5

Step 9:- Now you can begin writing a c/c++ program by starting the tc application located in c:\TC\BIN directory. This will application window as below.

cpp-installation-6

Installing C++ In Ubuntu/Linux

Here is how you can install C++ in Linux –

Step 1:- Open a terminal and use the following command to install the C++ compiler and essential tools –

If you are on Ubuntu and Debian use the following command

If you are on CentOS, Fedora and Redhat use the following command

Step 2:- Let’s verify the installation using the following command

Compile and Run C++ Program In Ubuntu/Linux

Step 1:- Create a file using a text editor program of your choice and save it with the .cpp extension. The .cpp file extension is used to specify C++ file.

Example:-

hello.cpp

Step 2:- Now, switch to the directory where the file is located. And, issue the following command to compile the C++ program –

Here, replace program-file-name. cpp with your c++ program file name and program-name with any name of your choice.

Example:-

Step 3:- If there is no compilation error, an executable file is created and you can see the output using the following command

Example:-

Installing C++ In Mac OS

Download and Install Xcode development environment to use GNU C/C++ compiler from Apple’s official website. the link is given below –

In this tutorial we have learn about the C++ Installation and its application with practical example. I hope you will like this tutorial.