Detailed explanation of Turbo C 2.0 settings
For beginners, Turbo C 2.0 is undoubtedly one of the simplest and most ideal environment for getting started programming. However, due to incorrect environment variable settings, the program cannot be compiled and run, this severely impairs the hard-earned self-confidence of beginners. In order to quickly solve this type of problem, so that everyone can focus on programming, we specially write this article to help beginners who are interested in programming.
1. Prepare tc2.0
We provide you with download for Turbo c2.0. The download location is:
Turbo C 2.0
After the download, decompress the package. You can use WinZip or WinRAR to decompress the package. Here, we assume that TC is extracted to the "X:/TC20" Directory (X indicates the drive letter). Of course, you can decompress it to any directory, for example, "D: /programing/C/TC20 ". Use" D:/programing/C/TC20 "to replace" X:/TC20 "during the following settings ".
2. Create an output directory
The output directory is used to store the execution Files written in TC and the temporary files used during compilation. Although this directory does not have to be available, in order to facilitate the management of a large number of applications you may write in the future, we strongly recommend that you create this directory. The following describes the operation methods in DOS mode and Windows window mode.
2.1 operation methods in DOS mode:
Enter the directory where TC is located, for example:
C:/> X:
X:/> Cd TC20
Then create the directory:
X:/TC20/> MD output
2.2. Operation Method in Windows:
Use resource manager or my computer to open the directory where TC is located, right-click the blank space, and choose "New (w)-> folder (f)" from the shortcut menu) "(this operation means to select" New (w) "first, then select" folder (f) "in the pop-up sub-menu, and then change the folder name to output.
Of course, you can use a directory of any name as the output directory, but remember to make changes in the next few steps to make the settings take effect.
3. Set TC Environment Variables
Run tc.exe in the tcdirectory first. This is the main program in the tc2.0 compiling environment. Press F10 to open the main menu and select "options-> directories". The corresponding meanings of the options to be set are as follows:
Include directories: directory where the include header file is located
Library directories: directory where the Lib library file is located
Output directory: temporary file and output directory of the final EXE file
Turbo C Directory: directory of TC
According to the directory structure on the front side, the following settings should be made:
Include directories: X:/TC20/include
Library directories: X:/TC20/lib
Output directory: X:/TC20/Output
Turbo C Directory: X:/TC20
If you extract TC to another directory, modify the settings accordingly.
4. Save settings
To save the trouble of setting Tc after startup, you need to save the setting result to the disk after completing the above steps. The specific operation is to select the menu "options-> Save options ". You will be asked about the name of the Environment file to be stored. for personal use, you can directly overwrite the default file by pressing "Y; if multiple users share the same TC, you can separate the execution files by setting the environment files with different output paths for management. You only need to import your own environment files for each use.
At this point, all the work from download to setup has been completed, and your TC has been working properly. If the program still cannot be compiled and run, this may be a syntax problem that occurs during your programming. Please carefully review the source code. The last thing to note is that the source code of the program is extremely important. It is best to store them in a dedicated directory rather than simply throwing them in the TC directory. Otherwise, it will be hard to find them after a long time.