CS-200 - C++

How to use Borland C++ in the lab

1. Insert your working diskette into drive a:

2. Run Windows by typing Win at the DOS prompt if Windows is not already running.

3. In the program manager window, double-click on Borland C++ 4.52.

4. The Borland C++ 4.52 window will appear. In this window, click once on the message Borland C++ which appears in the upper left-hand corner of the window. This causes the Borland C++ icon to appear.

5. Double-click on the Borland C++ icon, and the Borland C++ window will open.

6. From the menu bar at the top of the Borland C++ window, click onFile. A menu will appear with choices including New, Open, etc.

7. To create a new program or data file, click on New. To access (i.e., to open) an existing file on your diskette, click on Open. Then select the appropriate drive, after which a list of files on that drive will appear. You will then click on the name of the file you want to open.

8. After you have finished editing the file (or every few minutes during the editing process), save the file. For a new file, do this by clicking on File and then on Save as. You will then be able to provide a name for the new file. If you are saving a file which already exists on the diskette, click on the Save button instead of the Save as button. The edited version of the file will be saved without a new name being requested.

9. To print out the contents of the file (e.g., to list the program), click on File and then on Print. (You can also print out the file from a DOS prompt by using the Print or copy command.)

10. To compile your program, click on Project and then on Compile.

11. Once the program has been compiled successfully, you can run it by clicking on Debug and then onRun.

12. As the program runs, a window will open up (if you have any cin or cout instructions). The results of these instructions will appear in this new window. When the execution of the program has ended and you have seen the results in this window, you may print the contents of the window by clicking on the button in the upper-left-hand corner and then clicking onPrint in the menu which appears.

13. After you have finished with the contents of this window, be sure to close it before going back to the window displaying the program. You can close this window by double-clicking on the button in the upper left-hand corner.

14. To exit from c++, either double click on the button in the upper left-hand corner of the Borland C++ window, or click on File and then on Exit. If you do either of these before saving a program file which you have edited, you will be asked whether or not you want to save the changed file.

Sample program

#include int main () { int x; cout << "Input an integer number: "; cin >> x; cout << endl << "x= " << x << endl; return 0; }

To return to Dr. Caftori's page

To send her an

Last updated on 9/9/97