Running Dev-C++
blreichenau
For programming assignments that include one file (e.g. prog1.cpp):
- Start Dev-C++.
- Double click the shortcut on the desktop
or
- from the Start button:

-
- From the menu bar:
File
New 
Source File (Ctrl+N)

or
- From the Specials Toolbar, click the New button:
A new source file window will open.
- Type in your source code.
Note:
Older versions of Dev C++ open a new source file with the 'basic' program source code already included. If you have an older version of Dev C++ installed which automatically generates new file source code using the older style of C++ code as shown below, you need to make several changes in the code before typing in the rest of your program.

- Remove the .h from the two #include lines, so that they
read:
#include <iostream>
and
#include <stdlib>
- Change stdlib in the second line to: cstdlib
- Add the line using namespace std; after the two #include lines.
- Change return 0; to return EXIT_SUCCESS;
The screen should now look like the following:
Make note of the color coding used.
- Preprocessor directives are shown in green.
- Strings (anything enclosed in double quotes) are in red.
- Reserved words are in bold.
- Save the file.
- From the menu bar:
File
Save

or
From the Main Toolbar:
- Click the Save (Ctrl+S) button
- Type a name for the file, such as prog1.
- Click the Save button
.
Note:
- If you are using your own computer, you can save the program wherever you want; however, you should consider creating a folder to hold all of your C.S.1318 programming assignments.
- If you are using a shared lab machine, you are only able to save your program in the My Documents
folder. Before logging off the lab machine, be sure that you have saved or copied the
program to an auxiliary storage device, such as a floppy disk or memory key. I recommend that you transfer
your files to either your VMS account using WS-FTP or to your Linux account
using the Secure Shell File Transfer Client.
- Compiling the program.
- From the menu bar:
Execute
Compile (Ctrl+F9)

or
- Click the Compile button on the Compile and Run Toolbar.
- A window will open displaying any syntax errors found.
- Correct any compilation errors.
- Save the changes.
- Compile again.
- Repeat this procedure until the program is compilation error and warning free. You will see the following:
- Click the Close button.
- Now that your program is error and warning free, run the program. (You could use the Compile command followed by the Run command, or you can use the Compile & Run command if you are confident your code is compilation error free.)
-
Printing your work/results.
- To print screen output from within WordPad:
When the user output screen is displayed, strike Alt+Print Screen.
Open Word Pad, and paste.
File/Print…on the equivalent of CS_Letter laser printer
- To print source code from within Dev-C++:
File/Print Setup…Choose CS_Letter. (or the equivalent)
Print
Note: If the line that distinguishes the right margin is faint or not visable at all, do the following:
Tools
Editor Options (Choose a darker color for the right margin.)
