Search code examples
c++sublimetext3sublimerepl

How to use sublimeREPL to get C++ user input in Sublime Text 3 on Ubuntu 14.04


I installed Sublime Text 3 and sublimeREPL but I don't understand how to get C++ user input from programs.

It's been three days and I have not found the solution.


Solution

  • SublimeREPL is only for interpreted languages that support REPLs — "Read-Eval-Print-Loop" — such as Perl, Python, Ruby, R, Scala, Lisp, Haskell, etc.

    C++ is a compiled language that does not have a REPL, and so is unsupported by SublimeREPL.

    You'll need to run your compiled C++ program via an external shell in order to get user input.

    See this question (Compiled vs. Interpreted Languages) for the differences between compiled and interpreted languages. Read at least the first several answers, as the terms "compiled" and "interpreted" are not very good descriptors, and are not mutually exclusive.