Creating a C++ Program With Borland C++

[Return to Math 10 Homepage | Return to Math 61 Homepage]

Using Borland 4.5 or Borland 5.02

One invokes Borland C++ by clicking on the appropriate option on the main menu in the Kenna and Orradre computer labs, or (in O'Connor), by clicking on the Programming Languages folder, then clicking on the Borland C++ 5.02 folder, and then on the Borland C++ Icon.

To create a new file, one clicks on FILE in the upper bar menu, and then on NEW. Opening an old file, and saving files are done via the same menu.

To compile a program, one can either click on PROJECT in the upper bar menu, and then on COMPILE or merely press Alt-F9.

After compilation (without errors), to run a program, one can either click on DEBUG in the upper bar menu, and then on RUN or merely press Ctrl-F9.

NOTE: Most PC-program will use internal file handling statements to open and close input and output files. In cases where one wants to write to the screen, one should include the statement

           cin.getch();
or
           cin >> i;
(where i is declared as a character variable) right before the final return 0; statement in the main program. This will keep the output window open until a key is depressed. Otherwise, it will open and close immediately (usually before anyone can read anything on the screen!).


Using Borland C++ Builder 4

Borland C++ Builder 4 is available in the O'Connor labs, but not in the Kenna or Orradre labs. It provides a state-of-the-art IDE (integrated development environment) suitable for large programming projects and additional libraries to make programming graphical interfaces easy. The number of features, however, means that one needs to change the default environment (which will assume a large programming project) when using the IDE for a small program.

One invokes Borland C++ Builder 4 by clicking on the Programming Languages folder, then clicking on the Borland C++ Builder 4 folder, and then on the Borland C++ Builder 4 Icon.

After Builder 4 is launched, many windows will appear along with a menu bar across the top.

To edit and compile simple programs, reset the environment as follows.

FIRST, click on FILE in the upper bar menu, and then on CLOSE ALL.

THEN, click on FILE again, and then on NEW.

A NEW ITEM window will appear with many options. Click on the CONSOLE WIZARD icon, and another window will appear. In this window, make sure that for "Window Type" Console is checked and for "Execution Type" EXE is checked, then click on FINISH.

A new editing window will appear with a skeleton of code for you to fill in. You may wish to highlight all the code and delete it or merely delete those aspects that you will not need.

To compile a program, one can either click on PROJECT in the upper bar menu, and then on MAKE or merely press Ctrl-F9.

After compilation (without errors), to run a program, one can either click on RUN in the upper bar menu, and then on RUN or merely press F9.


[Return to Math 10 Homepage ]

This page is maintained by Dennis C. Smolarski, S.J. dsmolarski@math.scu.edu
© Copyright 1999 Dennis C. Smolarski, SJ, All rights reserved.
Last changed: 7 October 1999