Home > Article > Development Tools > How to run sublime test in c++ language
The steps to run a C program in Sublime Text are as follows: Install MinGW or Clang compiler Set up the corresponding build system Write and save the C code with ".cpp" extension Press Ctrl B or Cmd B to build the program Press Ctrl F5 or Cmd F5 to run the program
How to run C language in Sublime Text
Run Steps of C program
Running a C program in Sublime Text requires the following steps:
Detailed instructions
Compiler installation:
Build system settings:
MinGW: `
json
{
"cmd": ["g ", "-std=c 17", "${file}"],
"file_regex": "^(..1):([0-9] ):? ([0-9] )?:? (.)$",
"selector": "source.cpp"
}
Clang:
<code class="json">{ "cmd": ["clang++", "-std=c++17", "${file}"], "file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$", "selector": "source.cpp"</code>
Code writing:
<code class="cpp">#include <iostream> int main() { std::cout << "Hello, world!" << std::endl; return 0;</code>
<code>* **构建和运行:** * **Ctrl + B** / **Cmd + B**(构建)</code>
The above is the detailed content of How to run sublime test in c++ language. For more information, please follow other related articles on the PHP Chinese website!