Главная страница | назад





Article #21422: Using the free Borland C++ 5.5 Compiler: A Beginners' Guide

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...
[any command]/? view the help documentation for the command (VERY USEFUL)
cd foldername change directory to foldername
md foldername make directory called foldername
rd foldername remove directory foldername
edit filename.txt create a text file called filename.txt
bcc32 source.cpp compile/link the file source.cpp

  1. Open a DOS console window:
    • Start | Run | Type "command" into the Open field [Enter]
  2. Create a directory to store source in:
    • Type "cd\" to return to the root of your drive.
    • Type "md temp" to create the new folder.
    • cd temp
  3. Create a new source file in c:\temp:
    • 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:

    •   #include <iostream.h>
        int main(void)
        \{
         cout << "Hello." << endl;
         return 0;
        \}
    • Save the changes [Alt-F then hit S].
    • Exit edit. [Alt+F then press X].
  4. Compiling the program to create an executable:
    • 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.)

Last Modified: 17-APR-00