Sublime Text 3 + minGW cannot read cin. Run Command Line cmd successfully.

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.