Home

First created: Friday 6th January 2006, 5:17 PT, AHD
Last updated:  Friday 6th January 2006, 8:58 PT, AHD

How to use Dev-C++

Text version


Dev-C++ - An Integrated Development Environment (IDE) for C++ Programmers


Download and install Bloodshed Dev-CPP

Test that Dev-C++ is working correctly on your machine by following these simple instructions



Start up Dev-CPP.
If you see a "Tip of the Day" window, close it.

Select File -> New -> Source File (or just press Ctrl-N)

Select File -> Save As... and then select the folder to save your file to.

Note: If you're creating a C++ program from a Coquitlam College lab machine,
      you need to save to the C:\temp folder. 


In the File name: textbox, type in first

Your file will be saved in your chosen folder with a file name of first.cpp

You will then see the cursor flashing in a white code window with a tab heading of first.cpp. 
Type in the following text exactly as shown here:




// first.cpp
#include <iostream> // for cin and cout
using namespace std;
int main()
{
    cout << "Hello World!";
    cout << "\nEnding the program...\n\n"; 
    system("PAUSE");
    return 0;    
}   




Now select File -> Save All

The latest version of your program is now saved.

Now select Execute -> Compile

There will be a short delay while the source code is compiled to object code.
You should then see the "Compile Progress" window with a Status of Done and Errors of 0.

If you don't see that window, 
and instead you see the code with a red line through a statement,
check for mistakes on or near the red line, correct them, resave and recompile.

Once you see the "Compile Progress" window with a Status of Done and Errors of 0, 
your program has been successfully compiled to object code
which can now be executed (run).

To run your code:

select Execute -> Run.

You will then see a black console window showing the output
from the running program.
In the title bar you will see the full path
of the executable code (first.exe). 

You must press a key (any key) when this window is active
to end the program. The black console window will then close,
and you will be returned to the IDE.


WARNING: Before you can execute your program again,
you must close any open console window. 
So, if the Execute -> Compile option is not available to you,
you need to end the running program
by pressing any key in the black console window.

This concludes the instructions to edit, compile and run a C++ program.

To familiarise yourself with Dev-C++, try changing the first.cpp program,
resaving and recompiling to see what happens. 

email me




























Valid XHTML 1.0!

Valid CSS!