Saturday, January 14, 2012

Tutorial: How to Create My First Program in C++ using DevC++?

by eturo

To create a program it requires two special software i.e. editor and compiler. Editor is used to write source code and compiler to convert source code into the language that machines understands which is known as binary language.

An IDE or Integrated Development Environment - is one in which compiler and editor are combined into single package. After finishing with source code just click a button to create executable files. Dev-C++ is a development environment in which after writing the source code, we just have to press F9 and it complies and run both with just a single click.

I recommend you to download Dev-C++ because it is free and has all the features that you will need. Dev-C++ is a full-fledged public domain C++ environment. Dev-C++ supports the entire C++ language. It is an ANSI compliant. It has 32-bit compiler.

So feel free to download it from bloodshed.net. You will see various version of Dev-C++ there but download the latest one. (You can download the latest version here.)

Today, I will teach you how to create a basic or your first program in C++ using DevC++. 

Before anything else, do the following.... 

Step 1: Install first DevC++ into your computer. You can get it from the link posted above. You can also read the installation procedures in their official website. Here, I used the latest version (Dev-C++ 5 Beta 9.2 (4.9.9.2) of the software which was released in February, 21 2005 (matagal na actually). Please read the installation guide here.


Step 2: Now, after installing the compiler (Dev-C++), we are now ready to create our first ever (hehehe) program in C++. We will call or name it as "HelloWorld" in welcoming you to the world of C++ programming. Here is the sample output of the first program.

 

Now, to have a similar output just like above, below is the sample program source code with comments giving you some idea or information how the program works. You can copy it and paste it to your Dev-C++ compiler to compile and run.

Like Us on Facebook

Related Posts Plugin for WordPress, Blogger...