compiler for c++program,tutorial for c++
Hello, friends. Here in this post, I will discuss the making of a sample program that will be Windows friendly, easy to create and quick to debug through Codeblocks.
The C++ language also called C with classes is one of the core languages through which Windows is made. Its scope isn't just limited just to OS but also this language finds its uses as a deep rooted in the field of electronics viz. in the programming of ICs (integrated circuits).
That is why it is included in the curriculum at the intermediate level along with java. But unfortunately, the old compilers like Turbo C++ and Borland are no longer supported in the later versions of Windows(>Win7). So how to tackle this???? Just follow me.
Let me first introduce you to CodeBlocks IDE : a powerful open source IDE for cross-platform app designing which features easy to use interface along with a very able compiler and debugger.
You have to simply download and then install it to make yourself eligible to proceed to the next step. (You have your direct download link - Codeblocks).
After the installation is complete open the CodeBlocks.
At the startup page select "Create a new project". Then you will find a new window opened, select "Console application" and click on 'Go' button.
After that, you will find a window opened, opt for C++ and click next.
Give your program a suitable name without any extension (eg. MyProgram) and then give it a path. Click next when you are finished.
In the next step (debugging window), you have to leave as it is and then click finish. This will attach a suitable debugger to your program.
Now your program is ready. First of all to start making editions press ctrl+f9 to build and then ctrl+f10 to compile. Note that the source code is yet not visible to you. To make it appear, go to the location where your program is saved and lookout for ".cpp" file and open it with Codeblocks as a default program.
As soon as you open this .cpp file your source code is visible to you. Now start writing your program. Note that you will find that some codes are previously written in it. If you really want then delete all the written codes to rewrite them yourselves or add in between the written codes whichever you like.
Be cautious not to delete "using namespace std;" command or your program will not be build successfully by codeblocks.
Use #include<iostream> in place of #include<iostream.h> only in this case.
The others can be altered in any manner as you like.
COMMENTS