Author: | |
Website: | |
Page title: | |
URL: | |
Published: | |
Last revised: | |
Accessed: |
Dev-C++ is a free integrated development environment (IDE) for C and C++, and is distributed under the GNU General Public License. The IDE was written primarily for Microsoft Windows, and is compatible with Windows versions 7, 8 and 10. The original developers, Bloodshed Software, ceased active involvement in the project in 2005. The project was taken over by Orwell (Johan Mes) in 2011, who continued to develop and maintain it until 2020, Since then, development has continued under the auspices of U.S. computer software company Embarcadero Technologies.
Most of the example programs included in these pages were compiled and tested using the version of Dev-C++ first developed by Orwell (Johan Mes) in 2011, but you should be able to use the existing code with newer versions of Dev-C++ to compile and run the programs successfully. The current version is 6.3, released in January 2021, which can be downloaded here.
If you are running the Dev-C++ IDE on a Windows computer, when you create a new project it will be saved in your "my Documents" folder. You may well wish to create a dedicated folder to hold your C projects. To do this, proceed as follows:
To check that everything is working, we'll create a project called MyFirstProject and write a simple "Hello World!" type program. Before we do, however, we need to create a subdirectory of our Dev-C++ Projects directory called MyFirstProject to hold our project files.
// A first C Program.
#include <stdio.h>
void main()
{
char str[1];
printf("Greetings, Maestro!");
printf("\n\nPress ENTER to continue...");
gets(str);
}
If you run the program from within the Dev-C++ IDE, pressing the ENTER key once will cause a status message to be displayed in the DOS command window. Any further keypress will close the DOS command window. If you run the executable outside of the IDE (for example, by double clicking on the executable file in the project folder using Windows Explorer), the program will terminate immediately when the ENTER key is pressed.
If you run the program from within the IDE, pressing ENTER once generates a status message.
Most of the sample programs in these pages will require a single source file. From this point forward we leave it up to the reader to choose how they name and organise their projects, but we would recommend creating a new project folder for each new program as a matter of good housekeeping.