Sublime Text 3 is used to compile and run C language code. sublimetext

Source: Internet
Author: User

Sublime Text 3 is used to compile and run C language code. sublimetext

Sublime Text 3 is an excellent code editing software. The simple, lightweight, and fast interface is very popular.

Recently, he was used to edit the Data Structure Code. This requires the new compilation system. The specific method is as follows:

First:

Next is the key step. paste the following code into the pop-up editing page. The file name is name. sublime-build, and name is the name of the new compiler.

 1 { 2     "cmd": ["gcc","${file}","-fexec-charset=gbk","-o", "${file_path}/${file_base_name}"], 3     "file_regex":"^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$", 4     "working_dir":"${file_path}", 5     "selector": "source.c", 6  7     "variants": 8     [ 9     {10         "name": "Run",11         "cmd": ["cmd","/c","-fexec-charset=gbk", "gcc", "${file}", "-o", "${file_path}/${file_base_name}","&&", "cmd", "/c","${file_path}/${file_base_name}"]12         },13         {14         "name":"RunInCommand",15         "cmd": ["cmd","/c", "gcc", "${file}","-fexec-charset=gbk", "-o","${file_path}/${file_base_name}", "&&","start", "cmd", "/c","${file_path}/${file_base_name} & pause"]16     }17     ]18 }

To put it another way, there are a lot of compiler code on the Internet. Some may fail to be compiled due to version reasons, and some may cause garbled code after running. The code I posted above can be compiled and run perfectly after testing, and can be used safely.

Related Article

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.