Sublime Text 3 實現C++代碼的編譯和運行

來源:互聯網
上載者:User

標籤:ase   命令   優秀   接下來   sel   logs   g++   cto   art   

在資料結構代碼的編寫中,我選用了優秀的編輯器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 \"$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 \"$file\" -o \"$file_base_name\" && start cmd /c \"\"${file_path}/${file_base_name}\" & pause\""13         }14     ]15 }

以上代碼也避免了因編碼問題導致的亂碼現象。

Sublime Text 3 實現C++代碼的編譯和運行

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.