This is a vscode extension that runs C++ files while typing, providing useful line-by-line outputs inside the editor.
It's useful for debugging and finding out the outputs of parts your code. Removes the need to use debuggers, adding print statements or even compiling your code every time you type something new. Just type and view the results right beside your line inside your editor. Customized settings will be available soon.
Installation
Open VSCode Extension tab (Shortcut: ctrl+shift+X) and type 'cpp repl'
Install the extension named C++ Playground - Inline REPL
Usage
No need to configure anything, starts up on every C++ file automatically. Can be enabled/disabled from status bar.
ctrl+alt+shift+n for manual activation (Activated by default on cpp files)
ctrl+alt+shift+q for manual deactivation
Status bar item 🌐/⭕ indicates whether cloud compiler or local compiler is being used
Note
Input statements like cin and scanf must be removed or hardcoded. In future versions a workaround might be added. Example of hardcoded input:
istringstream iss(R"(
a multiline
input
example
)");
cin.rdbuf(iss.rdbuf()); // done
cin >> myString; // stores "a"
Features
Executes the code as you type and shows outputs beside each line
Makes it easier to debug and view values of variables from within editor
Can run using both cloud and local compilers
Lightweight and super fast
Requirements
If you use cloud compiler (default), it requires internet obvisously.
Else if you're on offline mode (switch using status bar icon), it will require C++ compiler (g++) to be installed on your system already
For tutorial on how to install C++ compiler on your system, visit this link or contact me.