在數據結構代碼的編寫中,我選用了優秀的編輯器Sublime Text 3,但是在實現C++代碼的編譯和運行上費了一番周折,接下來我貼出C++編譯系統的代碼,供各位參考。
編譯後是在彈出的CMD命令行窗口運行的,因爲若在Sublime Text 3運行則可能無法實現輸入等操作(?)。
1 {
2 “encoding”: “utf-8”,
3 “working_dir”: “$file_path”,
4 “shell_cmd”: “g++ -Wall -std=c++11 -fexec-charset=GBK “KaTeX parse error: Can't use function '\"' in math mode at position 10: file_name\̲"̲ -o \"file_base_name””,
5 “file_regex”: “(…[:])😦[0-9]+):?([0-9]+)?:? (.)$”,
6 “selector”: “source.c++”,
7
8 “variants”:
9 [
10 {
11 “name”: “Run”,
12 “shell_cmd”: “g++ -Wall -std=c++11 -fexec-charset=GBK “KaTeX parse error: Can't use function '\"' in math mode at position 5: file\̲"̲ -o \"file_base_name” && start cmd /c “”{file_base_name}” & pause""
13 }
14 ]
15 }
以上代碼也避免了因編碼問題導致的亂碼現象。