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:
- 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"
Copy after login
Code writing:
#include <iostream> int main() { std::cout << "Hello, world!" << std::endl; return 0;
Copy after login
<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!

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

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

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

Hot Topics



Golang and C each have their own advantages in performance competitions: 1) Golang is suitable for high concurrency and rapid development, and 2) C provides higher performance and fine-grained control. The selection should be based on project requirements and team technology stack.

VS Code To switch Chinese mode: Open the settings interface (Windows/Linux: Ctrl, macOS: Cmd,) Search for "Editor: Language" settings Select "Chinese" in the drop-down menu Save settings and restart VS Code

The main uses of Linux include: 1. Server operating system, 2. Embedded system, 3. Desktop operating system, 4. Development and testing environment. Linux excels in these areas, providing stability, security and efficient development tools.

VS Code One-step/Next step shortcut key usage: One-step (backward): Windows/Linux: Ctrl ←; macOS: Cmd ←Next step (forward): Windows/Linux: Ctrl →; macOS: Cmd →

Visual Studio Code (VSCode) is a cross-platform, open source and free code editor developed by Microsoft. It is known for its lightweight, scalability and support for a wide range of programming languages. To install VSCode, please visit the official website to download and run the installer. When using VSCode, you can create new projects, edit code, debug code, navigate projects, expand VSCode, and manage settings. VSCode is available for Windows, macOS, and Linux, supports multiple programming languages and provides various extensions through Marketplace. Its advantages include lightweight, scalability, extensive language support, rich features and version

VS Code supports Chinese settings, which can be completed by following the steps: Open the settings panel and search for "locale". Set "locale.language" to "zh-CN" (Simplified Chinese) or "zh-TW" (Traditional Chinese). Save settings and restart VS Code. The settings menu, toolbar, code prompts, and documents will be displayed in Chinese. Other language settings can also be customized, such as file tag format, entry description, and diagnostic process language.

VS Code The methods of multi-line commenting are: 1. Shortcut keys (Ctrl K C or Cmd K C); 2. Manually add comment symbols (/ /); 3. Select menu ("Comment Block"); 4. Use extensions; 5. Recursive comments (/* /) and block comments ({/ and /}). Multi-line comments help improve code readability and maintainability, but overuse should be avoided.

Compiling code in VSCode is divided into 5 steps: Install the C extension; create the "main.cpp" file in the project folder; configure the compiler (such as MinGW); compile the code with the shortcut key ("Ctrl Shift B") or the "Build" button; run the compiled program with the shortcut key ("F5") or the "Run" button.
