Using DevC++

You can get the DevC++ compiler from me or one of the TAs, download from the course site, or from Bloodshed. If you download from Bloodshed, select source code.

Starting a new program

File/New and select "Source File"
Enter your program by typing or cutting and pasting from another documment.

Compiling a program

Select Execute/Compile and Run or F9.
If you have made a syntax error, the Compiler window will open and indicate the line(s) and error(s).
Clicking on the error will highlight it in the program.

Common Errors

'variable name' undeclared: you forgot to declare the variable or, possibly have spelled it differently.
expected ; before "some code": you forgot a semicolon at the end of the line.
If you don't recognize an error, google it. There are DevC++ forums that have answered common questions.

Vanishing Console

The console window will disappear after the program is run. To prevent this, add system("pause"); to the end and it will pause until you type a character.
//heightb.cpp 
#include <iostream>
using namespace std;
int main()
{
   int feet, inches;
   feet = 6;
   inches = feet * 12;
   cout << "Height is " << inches << " in.";
   
   system("pause"); //so the window does not disappear until you type something
   return 0;
}