
JaVa CoDe
Senior Member

Jan 24, 2005, 3:38 AM
Post #1 of 3
(1545 views)
Shortcut
|
|
Compiling Tutorial
|
Can't Post
|
|
How do I use A Compiler? There are numerous compilers available for C++ programming. One of the easiest compilers to use is the Bloodshed Dev compiler. Doesnt really matter if u use one or the other the output result should be the same. You should already have downloaded Bloodshed Dev version 4.0. or any other compiler. After you have installed the compiler, you should go to Start:Programs:Dev-C++ and run Dev-C++. You may be asked whether you wish Windows to associate .c and .cpp files with the compiler; you should check Yes. After the program opens, go to File-New Project...; click on it. Select Console Application, and click ok. Enter a project name when prompted; enter the filename for your project. Dev-C++ will conveniently open a new file for editing, and this file will already contain the barebones of a C++ program. Delete what is shown in that file and enter the following: CODE #include <iostream.h> int main() { cout<<"The Compiler Works"; return 0; } To run this program, go to Execute-Run. You may be prompted to save your file; type a filename to save it. It will then execute the code you typed in. You probably won't see anything appear on the screen, although you might notice a brief flash of a DOS window. If you wish to force the compiler to leave that window open, plz do so. Keep in mind, when you create a finished program, you won't have a need to force the compiler to keep the window open, so you can remove the code to keep it open. How do I make an executable file? With Dev-C++, to make an executable file is as simple as going to Execute-Compile. You might be prompted to save your file; save it. You will then find a .exe (Warning this file could be malicious) (Warning this file could be malicious) (Warning this file could be malicious) file with the same name as the .cpp file in your My Documents folder; this .exe (Warning this file could be malicious) (Warning this file could be malicious) (Warning this file could be malicious) file is the finished program that you have created.
My train of thought has been delayed.
|