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:
- Install the compiler:First, you need to install a C compiler device. It is recommended to use MinGW or Clang.
- Set up the build system: Next, you need to set up a build system for Sublime Text. This tells Sublime Text how to compile and run the program. Tools -> Build System -> New Build System..., and then select the appropriate compiler.
- Write and Save Code: In Sublime Text, write and save your C code. Use files with the ".cpp" extension.
- Build the program: Press Ctrl B (Windows/Linux) or Cmd B (Mac) to build the program. This will compile the code and generate an executable file.
- Run the program: Press Ctrl F5 (Windows/Linux) or Cmd F5 (Mac) to run the program. This will open a terminal window and run the executable file within it.
Detailed instructions
-
Compiler installation:
- MinGW: https://sourceforge.net/projects/mingw-w64/
- Clang: https://clang.llvm.org/
-
Build system settings:
MinGW:
`
json
{
"cmd": ["g ", "-std=c 17", "${file}"],
"file_regex": "^(..1):([0-9] ):? ([0-9] )?:? (.)$",
"selector": "source.cpp"
}-
Clang:
{ "cmd": ["clang++", "-std=c++17", "${file}"], "file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$", "selector": "source.cpp"
-
Code writing:
#include <iostream> int main() { std::cout << "Hello, world!" << std::endl; return 0;
<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!

SublimeText is priced at $99 (starting from personal and commercial licenses), with a one-time purchase model that supports Windows, macOS and Linux: 1. A free trial version is available, and it is permanently used after purchase and is updated; 2. It can be downloaded from the official website or third-party store, but it is recommended to purchase from the official website to ensure flexibility.

You can get SublimeText by trialing for free, purchasing a license, or applying for an education license. 1) Free trial: No time limit, but you will prompt to purchase when saving the file. 2) Purchase a license: Pay $99 in one lump sum, get lifelong updates and support. 3) Education license: Students and educators can enjoy discounts and must verify their identity.

SublimeText is a powerful text editor suitable for a variety of programming languages and file formats. 1. Multiple selection and editing functions allow multiple locations to be modified at the same time to improve editing efficiency. 2. The command panel is accessed through shortcut keys and performs various operations, such as formatting code and managing plug-ins.

SublimeText is available for free, but every once in a while, a purchase prompt pops up. 1) It supports multiple programming languages, has a simple interface and a powerful plug-in ecosystem. 2) Users can optimize the user experience by closing unnecessary plug-ins, regularly updating and using shortcut keys.

SublimeText is suitable for beginners and experts. 1. Shortcut keys and command panels improve efficiency. 2. Package manager extension function. 3. Customize the details of the configuration file. 4. Multiple selection and editing functions are used to refactor code. 5. Search and replace function positioning and modify code. 6. Project management and version control integration facilitate project management.

The performance benefits of SublimeText are fast startup, multi-threading, and a rich plug-in ecosystem, but at the expense of high license fees, complex plug-in configurations, and potentially increased memory footprint.

SublimeText is suitable for users who pursue simplicity and highly customized, while VSCode is more suitable for users who need one-stop service and better user experience. The SublimeText interface is simple and complex, suitable for advanced users; the VSCode interface is modern and easy to use, suitable for beginners and team collaboration.

SublimeText is suitable for users who pursue speed and simplicity, while VSCode is suitable for users who need rich features and powerful integration capabilities. 1) SublimeText is known for its lightweight and highly customizable, fast and powerful multi-line editing. 2) VSCode is known for its scalability and integration, with built-in Git support and debugging tools, suitable for cross-language development.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Zend Studio 13.0.1
Powerful PHP integrated development environment

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

SecLists
SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

SublimeText3 English version
Recommended: Win version, supports code prompts!
