How can i Compile a C program on Dos prompt using tcc and tc

核能气质少年 提交于 2019-12-24 02:42:28

问题


I want to compile c program on dos prompt using tcc as well as tc without using c editor. please give the full procedure.


回答1:


I would look at the TCC documentation, specifically the quick start guide, provided on the TCC web page. Assuming you have some source code already, a compilation is as simple as

tcc -o executable.exe sourcefile.c

You can also run a C file directly with the -run option, as in

tcc -run sourcefile.c



回答2:


you can run code without using an editor by using

tcc -run -

Using argument "-" will open stdin and you can write the code within stdin and execute it on the fly.




回答3:


I'm not sure if you mean Turbo C or Tiny C Compiler.

With Turbo C it can be as easy as:

tcc.exe myfile.c

This will produce myfile.exe if all the source code is in myfile.c.

If you run tcc.exe without parameters it will show what parameters it accepts.

There's documentation for Tiny C Compiler and it probably can show its usage too if run without parameters or with a specific parameter like -? or -help.



来源:https://stackoverflow.com/questions/1787646/how-can-i-compile-a-c-program-on-dos-prompt-using-tcc-and-tc

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!