C plus plus is a compiled based language i.e., it needs to be compiled into an object files resulting from compilation of one or multiple files and hence are linked to an executable( .exe file). This compilation is a very complex process and thus we require special software program to do it for us and these special software program are Compilers.
For Windows users
If you want to run or setup the local environment for CPP on your personal desktop running on Windows, Mac OS or any other OS you would need to have following two softwares on your desktop
CPP editor or any Text editor: This software would help you write code in your preferred language CPP, there are many advanced editor present in market which supports intelligent code completion, Real time error finding and even the advanced ones helps in debugging. Some of the good Editors are Sublime, Atom, Notepad++, vim and many more names may vary from OS to OS but these are some of the best on Windows and Mac OS.
CPP compiler: CPP comes under the category of compiled languages i.e., it needs to be compiled by a compiler to make desktop understand it purpose. A compiled Language is the language in which the code, once compiled is expressed as the instructions for the machine it is running on. For instance the addition operation “+” in the code written by you would be simply changed to “ADD” instruction in machine code by compiler itself.
CPP compilers compile the CPP code (Generally with extension CPP) and make it run for you just at a click of one button many of them come with inbuilt editors but there editor might not be top notch as like of sublime and atom . Some of the freely available CPP compilers are DevCPP and turbo CPP (For absolute beginners), Code blocks, Microsoft Visual Studio (For advance development for Windows and its utilities).
GCC compiler: GCC compiler could also be installed in Windows you need to install MinGW, it can be installed from MinGW official page download the latest version and proceed with installing it at least with libraries GCC-core, GCC-g++ and the MinGW run time, and you can install others too as per your choice and likes.
After the installation is complete do not forget to add the bin sub directory of your MinGW installation to your System’s PATH variable which can be done by simply searching on your windows for “Edit Environment variables for your account” then click on “Advanced” tab inside it check for “Environment Variables” button inside it click open it Under the “System Variables” section (the lower half), find the row with “Path” in the first column, and click edit. The “Edit environment variable” UI will appear. Here, you can click “New” and type in the new path you want to add. From this screen you can also edit or reorder them. For a visual guide you might find a video for same easily on YouTube.
For Linux Users (You like to root? Don’t worry for compiling you need not :p )
Generally the latest builds of the Linux comes with pre-installed GCC but it’s better to be on safe side, so by opening the terminal you could verify the presence of GCC in your machine just go to terminal and type
g++ -v
If GCC is installed, then message would be printed with a note about GCC version, If GCC is not installed you need to install GCC to your machine to help you compile the CPP source code, for more detail on how to install GCC click here
For editor the linux come installed with Vim but you can download any text editor as per your choice as its work is limited to writing code.
For Mac users
In Mac as well you have option to go for CPP compiler such as code blocks to go for which come with its own editor also you can use sublime, atom or notepad ++ as a substitute to it, Mac also have support for GCC and the easiest way to obtain it is to download the Xcode development environment from Apple’s website and follow the simple installation instructions.