Sublime Text 3 to compile and run C language code

Source: Internet
Author: User
Tags sublime text

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

Recently began to use him to edit the data structure of the code, which requires a new compilation system. Here's how:

First of all:

Next is the key step, paste the following code into the pop-up edit page, the file name is name.sublime-build form, name is the new compiler name.

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     {Ten         "name":"Run", One         "cmd": ["cmd","/ C","-FEXEC-CHARSET=GBK","GCC","${file}","- o","${file_path}/${file_base_name}","&&","cmd","/ C","${file_path}/${file_base_name}"] A         }, -         { -         "name":"Runincommand", the         "cmd": ["cmd","/ C","GCC","${file}","-FEXEC-CHARSET=GBK","- o","${file_path}/${file_base_name}","&&","Start","cmd","/ C","${file_path}/${file_base_name} & Pause"] -     } -     ] -}

More to say, there are many compiler code on the Internet, some may be because the version of the reason can not compile successfully, some run will be encoded resulting in garbled appearance. The code I posted above is tested to be perfectly compiled and run, and can be used with confidence.

Sublime Text 3 to compile and run C language code

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.