How To Run C++ Program In Dev Cpp

How to write and compile C++ programs

Aug 13, 2015  In this tutorial I will tell you about how to configure notepad to run C, C, Java, Python, JavaScript, etc. Notepad is a popular and free. Install Dev-C. I installed from the Version 4.9.9.2 Setup File. Download graphics.h to the include/ subdirectory of the Dev-C directories. Download libbgi.a to the lib/ In order to use the WinBGIm subdirectory of the Dev-C directories. Whenever you #include in a program, you must instruct the linker to link in certain libraries.

In order to run a program and see it doing wonderful things, you should first write the program. The program can be written in any text editor, such as vi and emacs in Unix environment and using command prompt in DOS. There are also several Integrated Development Environment (IDE) packages available which provide a complete programming environment for C++ in which you can write, compile, run, and debug your program.

C++ programs are saved with extensions .C, .cc, .cpp, .cxx depending on the platform you are working upon.

Once you have saved a program, next stage is compiling it using a compiler which converts your C++ program into the object code which the computer can understand.

Compile using g++ compiler

If you are using UNIX environment and using g++ compiler, then compiling your C++ program is simple. After you have saved the program file, simply type the command

g++ program.cc –o program

where program is the name of the program. For example the name of our first program is first, then save it using extension “first.cc”. To compile, type

g++ first.cc –o first

To run the program, type first or ./first at the command prompt and your program will run.

Compile using DevC++ compiler

If you work on Windows and use DevC++, then editing and compiling is as easy as click of a button. DevC++ is an IDE which allows you to edit, compile, run and debug your program in the IDE itself. If you want to install DevC++ then install it from DEV C++ website.

  1. Once you have installed and configured the software, Write and save your program using DevC++ itself. Create a new program by clicking on New à Project.
  1. Choose Empty Project from New Project dialog and choose a name for the program, in our case first and click Ok.
  1. Write the code of the program and save it.
  1. Click on Compile button (third row, first button) to compile your source code. If there are any errors in your program, then a window at the bottom will specify the warnings.
  2. After program is compiled, click on Run button (next to compile).
  3. However, DevC++ has a problem. As soon as you Run the program, output window opens momentarily and then it closes. So to come around this solution, set a breakpoint at the end of main function and then click on Debug instead of running it.
  1. When you run the program, output window will show the string.

Compile using VC++

If you use Visual C++ toolkit for C++ programming, then the procedure is same as in DevC++.

  1. To write the source code>, Click on File à New Project. A dialog box will appear, click on A Empty Project and click Finish. Write your source code in the source code window.
  2. After you have saved your source code, click on Build button to compile the source code.
  3. Once the source code is compiled, click on Execute button to run the program. An output window will show the output of the program.


Now we have learnt how to edit, compile and run programs using compilers and IDE, its time to learn about more features of C++ language to get some real action. Next tutorial, Data Types and Variables tells about data types in C++, keywords and variables.

Go to the previous lesson or proceed to the next lesson
Table of contents

How To Use Dev C++ Compiler

  • Latest Version:

    DEV-C++ 5.11 LATEST

  • Requirements:

    Windows XP / Vista / Windows 7 / Windows 8 / Windows 10

  • Author / Product:

    Bloodshed Software / DEV-C++

  • Old Versions:

  • Filename:

    Dev-Cpp 5.11 TDM-GCC 4.9.2 Setup.exe

  • MD5 Checksum:

    581d2ec5eff634a610705d01ec6da553

  • Details:

    DEV-C++ 2020 full offline installer setup for PC 32bit/64bit

DEV-C++ is a fully-featured Programintegrated development environment (IDE) for creating, debugging and creating applications written in a popular C++ programming language. Even though tools for the development of C++ software have undergone countless upgrades over the years, a large number of developers located all around the world have expressed a wish to continue using DEV-C++. This IDE platform has proven itself as highly reliable and intuitive, giving developers access to all of their necessary tools, in-depth debugging, and most importantly, a stable error-free environment for the development of apps of all sizes – from small school tasks to large business projects intended for both internal and public use.

Dev C++ Program Examples

The app is an open-source IDE environment, offering software solutions and the necessary tools for C++ app development. However, be aware that its toolset is focused more on novices and basic programming, and that open source community has not updated its toolset for a considerable time. Still, what is present in its latest version represents a highly-capable C++ IDE that could be used for years without encountering any issue.
If you are a novice, are a student who wants to create C++ project in a stable and easy to use software environment, or even if you are a seasoned programmer who wants to access C++ programming inside small IDE that will not strain your computer resources, DEV-C++ represents a perfect choice. It has all the required tools and feature sets for creating small to mid-sized apps.

How To Run C++ In Dev C++


It runs on all modern versions of Windows and can be used without any restrictions for free. It was originally developed as an open-source fork of the Bloodshed Dev-C++ IDE.
Installation and Use
Even though DEV-C++ is filled with advanced compiler, debugger and a wide array of dev tools, it’s installation package is quite small (only around 50 MB) and therefore can be easily installed on any modern Windows PC or laptop. Just follow the onscreen instructions, and in mere seconds DEV C plus plus will be ready for running. Other more developed modern IDE environments, on the other hand, require much more storage space, and their installation can run for minutes.
Once up and running, you will be welcomed in a user-friendly interface that can be additionally customized to better fit your needs. The main window of the app follows the basic structure of many other modern IDE environments, with top row of dropdown menus and buttons that are shortcuts to its many built-in tools, a large vertical three-tabbed area for managing Projects, Classes and Debug listings, and of course, the main project area (with support for tabs) where you can start programming your apps. Both the app and the current project can be customized extensively. App Options window features tabs for Genera, Fonts, Colors, Code Insertion, Class Browsing, and Autosave customizations. Environment Options feature tabs for General, Directories, External Programs, File Associations, and CVS support customization.
Features and Highlights
  • Fully-featured IDE for developing C++ apps.
  • User-friendly interface with many tools for managing project development.
  • Resource-light and unobtrusive feature set.
  • Focused on novices and mid-level programmers who want stability and reliability.
  • Powerful compiler and debugger.
  • Compatible with all the modern versions of Windows OS

How To Run C++ Program In Dev Cpp Program