Home ] Up ]

 

How to install and use the Borland Turbo C++ ver1.01 compiler on your USB Flash Drive

Note: USB Flash drives are not usable on Windows 98 & Windows ME without adding special software drivers.

INSTALLING the Borland Turbo C++ compiler

1)   Click here to download TCLITE

2)   When you see the dialog window "File Download" Do you want to open or save this file?

3) Click in Save and select your USB Flash Drive (the E: drive?? The rest of this document will use E: to represent the USB flash drive). Save USBTurbo.zip file to the root directory (E:\) of your flash drive.

4) After the USBTurbo.zip file downloads to your Flash Drive, (E:\) open the file by double clicking it. Windows XP knows how to open and extract the files contained in a .zip file, but if your as isn't XP, you'll have to use WinZip or a similar utility.

5)   When you extract all files to E:\ make sure the "Use folder names" option is selected.

6) After unpacking/unzipping USBTurbo.zip, the root directory of your flash drive should contain a file named USBPATH.BAT, and a folder named turbo, containing five subfolders (BGI, BIN, INCLUDE, LIB, and TOUR)

7) If all 97 files in the USBTurbo.zip wound up in E:\, you didn't select the "Use folder names" option when you extracted the files to E:\ You'll have to delete them all and go back to step (5) above.

USING the Borland Turbo C++ compiler

1)   Insert your USB Flash drive into a USB port and pause until your computer recognizes it.

2) Use Windows Explorer to see what drive letter your computer assigns to your flash drive. This document assumes E

3)   Click Start -> Run ... then enter cmd to open a "DOS" or "command" window

4)   type E: <enter> to change the working drive to the flash drive.

5)   type \usbpath e <enter> (or \usbpath f if the drive letter of the flash drive is F:)

6)   type tc <enter> to start up the compiler.

7)   Any file you create from inside the tc compiler will be saved in the E:\turbo directory

8)Any file you wish to read from inside the tc compiler should be stored in the E:\turbo directory.

9) When you want to terminate the compiler, save the source code and then type <alt>-x to exit the compiler

How to run a sample C program with TC Lite

 

  1. Enter the following program. It reads in one integer and prints out the sum of the integers up to that value. E. G., if you enter four, the computer computes and prints out the value of 1 + 2 + 3 + 4.
    #include <stdio.h>
    main () {
    int i,n,sum;
    scanf("%d",&n);
    sum=0;
    i=1;
    while (i<=n) {
      sum = sum + i;
      i++;
    }
    printf("%d",sum);
    }
    
  2. First we run the program. Press CTRL-F9.
  3. The computer will switch to DOS to enter a number. Enter the number 4.
  4. Press ALT-F5 to see the answer.
  5. Press the RETURN key.
  6. Now we debug the program. We enter variables to "watch" by press CTRL-F7. Then we step through the program with F7.
    Press CTRL-F7
  7. Enter n and a carriage return. (You can ignore the undefined symbol error)
  8. Scroll down, enter carriage return again, and type i
  9. Scroll down, enter carriage return again and type sum
  10. Press F7 key slowly to step through the program. Note that when you hit the scanf statement, the computer will take you to the DOS screen to enter the value. Press 4.
  11. When the computer finishes, press ALT-F5 to see your output.
    Note that you can also press CTRL-F4 to look at a variable's value without using the Watch window.
  12. Press F2 to save your work. Enter C:\myprog.c. (Or you can use some other name or location that you remember.)
  13. Press ALT-X to quit TC Lite.