- >Open up Dev-C++
>Goto 'File' and click 'New Project'
>Click on 'Console Application' (its like an icon thingy)
>Make sure the 'c++ project' radio button is selected
>Click 'OK'
>Type in "Test Project" into the 'Project Name' box and click 'OK'
>Save "Test Project" to a new folder that you can easily find
>A text editor should now replace the grey area in Dev-C++
>Goto 'Execute' and click 'Compile and Run'
>Name the file 'Main' and click save
>Did you see a strange black box flash for an instant?
>Now erase all that stuff in the editor and paste the below code in.
Code: Select all
#include <stdio.h>
#include <iostream>
//Hey look, this is a comment! Use these to record what you
//were thinking when you code something
//Declaring an Integer
int Number;
//Program execution starts here
int main(int argc, char *argv[])
{
//Print out this string to the console
cout << "Woot Woot! It works! Now enter a number foo!\n";
//Get input from the user
cin >> Number;
//Display what the user entered
cout << "\n\nYou entered the number " << Number;
cout << "\n\n\n\nEnter another number and this program will quit.";
//Get more input from the user
cin >> Number;
//Return to the Operating System!
return 0;
}
- >Goto 'Execute' and click 'Compile and Run'
>The program should compile and execute with NO errors.