PF Lab 1
PF Lab 1
Dev-C++ is a Free Software distributed under the terms of the GNU General Public License
(GPL). The IDE can be downloaded here:
https://bloodshed-dev-c.en.softonic.com/download
Dev-C++ can be installed on any Windows machine with Windows XP/7/8/10. This tutorial uses
Dev-C++ 5.11 on Windows 10 (configuration in the computer labs as of course 2016-2017). For
the sake of simplicity, use the default installation options in your home computer.
Start the IDE from the Program folder Dev-C++ or Bloodshed Dev-C++.
File
Source Code Editor
Explorer
Results Window
The IDE window includes three sub-windows: the Project Files Explorer, the Result Tabs, and
the Source Code Editor. These windows can be resized and minimized.
The Files Explorer window shows the name of the project and the included files. The Project
tab usually contains a single file with the source code of the program. In this pane, we can find
two additional tabs: Classes and Debug. Classes tab shows the functions of the program.
Debug tab shows watched variables in the debugging process.
The Results window is used to present the results of the actions of the IDE: compilation errors,
compiling directives, debugging commands, etc.
Once the Source File has been created, we can start writing our C++ program.
It is recommended to use the classic color configuration of the editor (Tools > Editor Options
> Syntax > Color Speed Settings > Classic) and to activate the support for opening and closing
brackets (Tools > Editor options > General > Highlight matching braces / parenthesis).
The editor highlights with different colors keywords and other elements of the C++ language.
The classic scheme uses:
To run a program, the source code must be compiled and linked. Dev-C++ performs the
complete process by clicking the Compile button or from menu (Execute > Compile or
pressing F9 key).
Compile Button
The editor displays the File Save Dialogue Box to save the file before compilation and execution
as shown.
Figure 6. Save the source code file
Select appropriate folder and specify the filename. Then click Save to store the file permanently
on the local drive. Once the compilation process is finished successfully the log will be displayed
in Results Window as shown.
Then execute/run the program by clicking Run button or from menu (Execute > Run or
pressing F10 key).
It is possible to compile and run the program in a single step by clicking Compile & Run
button or from menu (Execute > Compile & Run or pressing F11 key).
Figure 9. Compile and Run in one-step
Assuming you did not make any syntax errors on your code, you should see a similar output
window running your program.
Figure
10. Displaying the output window