C++ interpreter / console / snippet compiler

后端 未结 6 617
醉酒成梦
醉酒成梦 2020-12-10 07:24

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

6条回答
  •  长情又很酷
    2020-12-10 07:35

    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.

提交回复
热议问题