- see the blue handout for instructions, if needed
- start - All Programs - C.I.S - Bloodshed Dev-C++ - Dev-C++
It will give you messages about bugs and about where it is storing your files, and how you can change the location where your files are stored. - OK
Dev-C++ First Time Configuration: Accept the defaults: - Next, - Next, - Next, - OK
Tip of the day: - Close
This step is important. If you do not do it, sometimes you will not get the correct results for the C programming language.
In the Menu select: -Tools - Compiler Options
Check: - the box: Add the following commands when calling compiler
In the larger next box type: -std=c99 (No spaces; in this case you need to type the - ) - OK
In the menu: - File - New - Source file
- You can now type your program in the file window, which is now open
- At the end, before the line return 0; at the end of your program, you must type:
int temp;
printf("Enter an integer and press Enter to exit the program: ");
scanf("%d", &temp);
Save your newly typed code:
In the menu: - File - Save As - In your Documents select a folder, where you want it put
- Give the file a name ending with .c, such as lab1.c Be sure to type the .c at the end. - Save
In the menu: - Execute – Compile
If it is correct a window will say Done, click - Close
Errors will show in the window at the bottom.
Scroll this window to see each error.
Double click on an error to find the location of the error.
Try to fix one or two errors; then compile again.
When there are no errors and no warnings, you are ready to run the program
- Execute - Run
Look at the results; if it is not what you need for the final results – type: x Enter
Type revisions to your code, build the machine code again, and run it again
When
you have tested your results several times successfully,
run your
program with the test data specified by the instructor,
to get the
final result.
In the execution results window:
- click the C:\ icon in the top left - Edit - Select all
- click the C:\ icon in the top left - Edit - Copy
In your program, in the Execution results comment at the end of the program:
/* Execution results
- right click here - paste
*/
Do not print until you are satisfied the program is correct, and
the final results are included with the data specified by the instructor.
- Click in the frame that contains your code, so your code file is selected
- File - Print