C++ 解释器/控制台/代码片段编译器
我正在寻找一个可以输入 C++ 代码片段的程序 在一个窗口中,按下一个按钮,然后在另一个窗口中获取输出。 编译应该以某种方式隐藏在按钮后面。 上一个 每个片段的基础就可以了,完全互动可能会问 太多了。 它应该在 Linux/Unix 下运行。 主要用例是 学习/测试/简短的调试等。
我发现的相关内容:
--Python 的 Reinteract 项目(我被告知 sage 具有类似的功能)
--C# 的相同线程:C# Console?
——来自 CERN ROOT 项目的 CINT 解释器 (可能很接近,但也许有更舒适的应用程序)
——一些名为“快速编译”或“代码片段”的程序,售价为 M$。
I am looking for a program where I can enter a C++ code snippet
in one window, press a button, and get output in another window.
Compilation should somehow be hidden behind the button. On a
per-snippet basis would be fine, full interactive probably asking
too much. It should run under Linux/Unix. Main use case would be
learning/testing/short debugging, etc.
Related stuff I found:
-- the Reinteract project for python (which i'm told sage has features similar to)
-- the same thread for C# here: C# Console?
-- the CINT interpreter from the CERN ROOT project
(which may be close, but maybe there are more comfortable apps around)
-- some programs called Quickly Compile or Code Snippet, which are M$.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
http://codepad.org/ 非常适合此目的。 默认情况下,当您点击“提交”时,它将运行您粘贴的内容并显示结果(或您可能遇到的任何错误)。
http://codepad.org/ works nicely for this purpose. By default, it will run what you paste when you hit submit and display the result (or any errors you might have).
Dinkumware 有一个相关页面,您可以选择编译器
http://dinkumware.com/exam/default。 ASPX
Dinkumware has a page for this AND you can choose the compiler
http://dinkumware.com/exam/default.aspx
做这样的事情吗?
只需将 C# 片段代码复制到剪贴板,然后输入 csc.exe 即可测试它:
http://reboltutorial.com/blog/redirect-shell-to-rebol -控制台/
Do something like this ?
test a C# snippet code by just copying it to the clipboard and then type csc.exe:
http://reboltutorial.com/blog/redirect-shell-to-rebol-console/
Cling(交互式 C++ 解释器,构建在 LLVM 和 Clang 库之上):https://root. cern.ch/drupal/content/cling
Cling (interactive C++ interpreter, built on the top of LLVM and Clang libraries): https://root.cern.ch/drupal/content/cling
只需配置您的代码编辑器即可编译并运行您的代码片段。
大多数代码编辑器都能够将当前缓冲区/文件“发送”到外部工具。 我配置一个编辑器键绑定来编译当前缓冲区,另一个键绑定来执行上次编译的内容(实际上是运行与当前缓冲区具有相同基本文件名且扩展名为“.exe”的文件)。 我的经验是使用 Windows,但在 Unix/Linux 上也可以完成相同或类似的操作。
然后,只需按一下键即可进行编译,然后再按一下键即可运行我刚刚编译的内容。 这也可以很容易地只需按一次键即可进行编译和编译。 运行,但我设置了几个键绑定来使用各种不同的编译器进行编译。 这样我就可以使用最新的 MSVC、MSVC 6、MinGW GCC、Comeau 和 Digital Mars 编译器轻松测试代码片段以检查差异。
Just configure your code editor to compile and run your code snippets.
Most code editors have the capability of 'sending' the current buffer/file to an external tool. I configure one editor key binding to compile the current buffer, and another key binding to execute whatever was last compiled (actually to run whatever has the same base filename as the current buffer with an '.exe' extension). My experience is with Windows, but the same or similar can be done on Unix/Linux.
Then it becomes one keystroke to compile and another to run what I jut compiled. This could also easily be just a single keystroke to compile & run, but I have several key bindings set to compile using various different compilers. That way I can easily test snippets using the latest MSVC, MSVC 6, MinGW GCC, Comeau and Digital Mars compilers to check for differences.
我会这样做:
在“输出”窗口中,您可以在输出文件上运行“tail -f”,以便在新输出到达时不断更新。
I would do it like this:
In the 'output' window, you can run 'tail -f' on the output file to continuously update when new output arrives.