Sublime Text 3 + minGW cannot read cin. Run Command Line cmd successfully.
Environment Description:
Recently, I found a good editor sublime text. Click here to download it from the official website, for short, ST. I use ST3 and minGW as the compiler. Click here to go to the official website, after downloading the package, you must install the package online. After installation, you must add the path of the bin directory under the installation directory to the path environment variable.
Then, press ctrl + B to compile the edited text in ST3. The compilation is successful, for example:
Problem description:
ST3 cannot perform input operations on cin, scanf, and so on during running. That is to say, it is annoying to directly continue the operation when the input is not allowed... For example:
Solution:
Brief introduction:
Instead of the built-in input of ST3, the command line of windows cmd is used for output. After all, this is consistent with the vc6.0 input learned by most people ..
Concrete steps:
1. Go to ST3 and click preferrence-> Browse Packages in the menu bar,
2. Create a new file named C. sublime-build (note not to modify the file name and Case sensitivity ).
For example:
3. open the file in notepad and add the following content.
4. Click preference-> Key Binding-User and add the following line.
{"Keys": ["ctrl + alt + shift + B"], "command": "build", "args": {"variant": "RunInCommand "}}
Ctrl + alt + shift + B Corresponds to the shortcut key during execution. Of course, you can also use another key combination.
After editing and saving, press ctrl + shift + c to call cmd to run the command.
This is a success!
Ubuntu 12.10 install and crack Sublime Text 2
Install Sublime Text 2 on Ubuntu 13.04
Code artifact-Sublime Text package management tools and extensions
How to Develop the Sublime Text 2 plug-in
Install and crack the Sublime Text 2 editor in Windows Mac Linux
Text Editor Sublime Text User Experience