有 C 的翻译吗? [英] Is there an interpreter for C?

查看:28
本文介绍了有 C 的翻译吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否有类似 C 解释器的东西.也就是说,在 Linux 终端中,我可以输入python",然后在该解释器中编码.(我不确定解释正确的词).这对于测试不同的东西真的很有帮助,我很好奇 C 是否存在类似的东西.尽管我对此表示怀疑.我唯一能想到的就是 C shell ...

I was wondering if there is something like an interpreter for C. That is, in a Linux terminal I can type in "python" and then code in that interpreter. (I'm not sure interpreter the right word). This is really helpful for testing different things out and I'm curious if something similar exists for C. Though I doubt it. The only thing I can think of that would do it would be the C shell...

推荐答案

有很多 - 如果您缩小问题的范围,我们或许可以针对您的需求提出一些具体建议.

There are many - if you narrow down the scope of your question we might be able to suggest some specific to your needs.

一个著名的解释器是Ch:用于脚本计算的 C/C++ 解释器";Dobbs 博士详细介绍:

A notable interpreter is "Ch: A C/C++ Interpreter for Script Computing" detailed in Dr. Dobbs:

Ch 是一个完整的 C 解释器支持所有语言功能和ISO C90 标准库标准,但扩展了 C高级功能,例如字符串类型和计算数组为一流的对象.

Ch is a complete C interpreter that supports all language features and standard libraries of the ISO C90 Standard, but extends C with many high-level features such as string type and computational arrays as first-class objects.

Ch 标准是免费软件,但不是开源软件.只有 Ch 专业人士拥有您可能想要的绘图功能和其他功能.

Ch standard is freeware but not open source. Only Ch professional has the plotting capabilities and other features one might want.

我以前从未看过这个,但是手头有一个 c 解释器听起来非常有用,而且我可能会添加到我的工具集中.感谢提问!

I've never looked at this before, but having a c interpreter on hand sounds very useful, and something I will likely add to my toolset. Thanks for the question!

刚刚发现我最喜欢的编译器之一,TCC,将执行 C 脚本:

Just found out that one of my favorite compilers, TCC, will execute C scripts:

它还处理 C 脚本文件(只是添加shebang线#!/usr/local/bin/tcc -run"到C 源代码文件的第一行在 Linux 上直接执行.

It also handles C script files (just add the shebang line "#!/usr/local/bin/tcc -run" to the first line of your C source code file on Linux to have it executed directly.

TCC 可以从中读取 C 源代码使用-"时的标准输入'infile' 的位置.示例:

TCC can read C source code from standard input when '-' is used in place of 'infile'. Example:

echo 'main(){puts("hello");}' | tcc -run -

这篇关于有 C 的翻译吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆