I am currently running Windows 10 64bit OS and I have install Turbo C4 suppose I don't to use the editor provided by Turbo C4 instead I want to write in a Notepad and then manually compile it using command prompt.
I am aware that Turbo C4 compiled programs won't run in our modern OS but we can use dosbox which is provided in Turbo C4.
Suppose my file name is test.cpp
Then what should I write in my console of command prompt in order to compile and run a c plus plus program using the TCC compiler provided by Turbo C4.
Guys please help me with this,
The command line utility for compiling with Turbo C is called tcc
.
You can compile your code like this: tcc strange.cpp
. If the program was compiled correctly you will find a strange.exe
. Put it on a computer that fulfills the requirements and run it or use your dosbox emulator.
You might need to set up environment variables to find header files and libraries.
To make your life easier I would create a (DOS) batch file with this content:
@echo off
SET PATH=%PATH%;Whatever_else_you_need
SET ...=...;Whatever_environment_variable_you_need
TCC %1.cpp
Then call this batch using dosbox -c foo.bat strange
. See the docs of dosbox for more details.
If you want to run your exe immediately after compilation, just add ...
%1.exe
... to you batch file.
See here for some more details about Turbo C and compilation: https://codingfox.com/how-to-execute-a-c-program-in-command-prompt-using-turbo-c-compiler/