如何在Sublime Text中編譯C和C++(How To Compile C&C++ in Sublime Text)

How To Compile C&C++ in Sublime Text

This article is base on Sublime Text 3 在終端機 編譯 c 或 c++ [ CMD 命令 輸入 scanf cin windows linux ]

Step 1 Install MingGW

Install MingGW AutoInstall.exe

Step 2 Restart your Computer

Step 3 Open your CMD

type gcc & g++ and see the output. It should look like the result below

if error occurred, you can set your environment variable manually. Just follow the image below

Image for post
Image for post

Step 4 Open Sublime Text

Copy and paste the code below

For C:

Press Ctrl+B -> Choose C Single File — Run

For C++:

Press Ctrl+B -> Choose C Single File — Run

Now, you can see the output like this:

Written by

Machine Learning / Deep Learning / Python / Flutter cakeresume.com/yanwei-liu

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store