4.9 Executing


4.9 Executing

Executing is the name of the procedure for running the program. When code has been compiled, it can be run in the same way as a user would run and use a program. It's like slipping a DVD into the drive and pressing "Play." The final end users do not typically use software until it has been tested because, even if there are not mistakes grammatically (syntactically) in the C++ source code, there can be other mistakes that are not detected by the compiler. These mistakes are called run-time errors. As the name implies, run-time errors occur during the execution of a program. They are not detected by the compiler because the source code is syntactically correct, but there are other kinds of errors that the compiler cannot foresee. If a program has crashed or malfunctions before your eyes, it's likely you have seen a run-time error at work. For example, if a program is written to save a file to disk, but somehow the user chooses that disk to be read-only, then the program will encounter an error as it attempts to write to a read-only disk. Thankfully, most foreseeable run-time errors can be accounted for through good programming practice so such potential errors are minimized. Thus, writing code to handle unexpected situations is called error handling. However, as we shall see, there are some errors that cannot so easily be foreseen and often remain in software. Such errors that make their way into a final product become known as bugs.

4.9.1 Executing on Visual Studio

To execute a program on Visual Studio, press the F5 key or click on the Start button.

image from book
Figure 4.14

4.9.2 Executing on Code::Blocks

To execute a program on Code::Blocks, press the F8 key or click on the Run button.

image from book
Figure 4.15

4.9.3 Executing on Dev C++

To execute a program on Dev C++, press the Ctrl+F10 key combination or click on the Run button.

image from book
Figure 4.16




Introduction to Game Programming with C++
Introduction to Game Programming with C++ (Wordware Game Developers Library)
ISBN: 1598220322
EAN: 2147483647
Year: 2007
Pages: 225
Authors: Alan Thorn

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net