<< Chapter < Page | Chapter >> Page > |
High-level language programs are usually written (coded) as ASCII text into a source code file. A unique file extension (Examples: .asm .cob .for .pas .c .cpp) is used to identify it as a source code file. As you can guess for our examples – Assembly, COBOL, FORTRAN, Pascal, "C" and "C++" however, they are just ASCII text files (other text files usually use the extension of .txt). The source code produced by the programmer must be converted to an executable machine code file specifically for the computer’s CPU (usually an Intel or Intel compatible CPU within today’s world of micro computers). There are several steps in getting a program from its source code stage to running the program on your computer. Historically, we had to use several software programs (a text editor, a compiler, a linker and operating system commands) to make the conversion and run our program. However, today all those software programs with their associated tasks have been integrated into one program usually called a compiler. However, this one compiler program is really many software items that create an environment used by programmers to develop software. Thus the name: Integrated Development Environment or IDE.
The following figure shows the progression of activity in an IDE as a programmer enters the source code and then directs the IDE to compile and run the program.
Upon starting the IDE software the programmer usually indicates he wants to open a file for editing as source code. As they make changes they might either do a "save as" or "save". When they have finished entering the source code, they usually direct the IDE to "compile&run" the program. The IDE does the following steps:
Despite our best efforts at becoming perfect programmers, we will create errors. Solving these errors is known as debugging your program. The three types of errors in the order that they occur are:
There are two types of compiler errors; pre-processor (1st step) and conversion (2nd step). A review of Figure 1 above shows the four arrows returning to the source code so that the programmer can correct the mistake.
During the conversion (2nd step) the complier might give a warning message which in some cases may not be a problem to worry about. For example: Data type demotion may be exactly what you want your program to do, but most compilers give a warning message. Warnings don't stop the compiling process but as their name implies, they should be reviewed.
The next three figures show IDE monitor interaction for the Bloodshed Dev-C++ 5 compiler/IDE .
Depending on your compiler/IDE, you should decide where to download and store source code files for processing. Prudence dictates that you create these folders as needed prior to downloading source code files. A suggested sub-folder for the Bloodshed Dev-C++ 5 compiler/IDE might be named:
If you have not done so, please create the folder(s) and/or sub-folder(s) as appropriate.
Download and store the following file(s) to your storage device in the appropriate folder(s). Following the methods of your compiler/IDE, compile and run the program(s). Study the soruce code file(s) in conjunction with other learning materials.
Download from Connexions: Demo_Pre_Processor_Compiler_Errors.cpp
Download from Connexions: Demo Compiler_Conversion_Errors.cpp
Download from Connexions: Demo_Linker_Errors.cpp
Download from Connexions: Demo_Logic_Errors.cpp
Notification Switch
Would you like to follow the 'Programming fundamentals - a modular structured approach using c++' conversation and receive update notifications?