So, you have finished downloading and installing the free Borland C++ 5.5 Compiler, but now you are not quite sure how to approach creating your first program. Chances are, the development tools you are familiar with use an integrated development environment (IDE), which combines a text editor, compiler/linker, and debugger. The software that you have just downloaded is the compiler/linker that can be used on source code files created using a basic text editor provided with your computer.
Let's begin by introducing the basic commands you will use...
||view the help documentation for the command (VERY USEFUL)
||change directory to foldername
||make directory called foldername
||remove directory foldername
||create a text file called filename.txt
||compile/link the file source.cpp
- Open a DOS console window:
Create a directory to store source in:
- Start | Run | Type "command" into the Open field [Enter]
Create a new source file in c:\temp:
- Type "cd\" to return to the root of your drive.
- Type "md temp" to create the new folder.
- cd temp
Compiling the program to create an executable:
- Type "edit hello.cpp" to open or create a new text file with a *.cpp extension.
- Paste or type the following code in the editor:
cout << "Hello." << endl;
- Save the changes [Alt-F then hit S].
- Exit edit. [Alt+F then press X].
- Type "bcc32 hello.cpp" to compile/link your program.
- Run the application you created by typing "hello" at the command line.
(The output will appear below your last command line.)