You are on page 1of 5

IFF1444-Intro.

to Programming

Bloodshed Dev C++ Tutorial This tutorial is to demonstrate the basic steps involved in coding, compiling, executing, and testing a program in the Bloodshed Dev-C++ (version 4.9.9.2). You can obtain and install this software on you computer from this official website: http://www.bloodshed.net/dev/devcpp.html Once you have downloaded the installer, run setup program, accept all default options. Follow the directions below in the order indicated: 1. Start Dev-C++ from the start menu. 2. From the "File" menu, choose "New Source File" (or click on the "Source file" button, the third from the left on the button bar (just under the menu bar). An insert cursor (vertical blinking line) will appear in the edit window.

Ms. Azimah, ICT dept.

IFF1444-Intro. to Programming

3. Type the following line: /* test.c - Your Name */ 4. Save your program as follows: a. From the File menu, choose "Save as ..." b. In the "Save File" dialog box that opens, navigate to the directory where you want to save your source file. c. In the "File name" text box, change the file name to: test.c d. Click on the Save button to save the file.

5. When you return to Dev-C++, the name of your file should appear in the tab above the text window. Now enter the rest of the program.

Ms. Azimah, ICT dept.

IFF1444-Intro. to Programming

6. When you have finished entering the program, save it by clicking on the diskette icon (the fourth one from the left) on the button bar (or File >> Save). 7. Compile your program: From the "Execute" menu, choose "Compile".

8. If you typed the above program perfectly, the Compile Progress status window will display the status "Done", with 0 errors and 0 warnings.

Ms. Azimah, ICT dept.

IFF1444-Intro. to Programming

9. If this is not the case, you have syntax errors (typos) in your program that need to be fixed before it can be run. To do this: a. Scroll in the bottom window to display the first syntax error. b. Double-click anywhere in the line that explains the error. In the Edit window, an indicator will show you in which line of your program the compiler thinks your syntax error occurred. Read the explanation of the error and compare your typed line with the program listing above. The error may in this line or a line that comes before it. Identify and correct the error.

Ms. Azimah, ICT dept.

IFF1444-Intro. to Programming

10. Repeat steps 6-8 until you have corrected all your syntax errors. 11. Run your program: Close the Compile Progress window, and from the Execute menu chose "Run" (or click on the second icon from the left on the second button bar).

12. A console window will appear and your program will be running. Your program will accept data, and compute and display the result and the message "Press any key to continue." When you do, the console window will close and you will return to Dev-C++. If you want to execute your program again, from the "Execute" menu, choose "Run". This program should work fine, but usually you will find logic errors in it that will need to be corrected by repeated analysis, editing, compiling, and testing. 13. When you are finished, exit Dev-C++ from the File menu.

Ms. Azimah, ICT dept.

You might also like