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.