search
HomeDevelopment ToolsnotepadHow to compile and run notepad in c

How to compile and run notepad in c

notepad怎么编译运行c?

第一步:写入c代码

#include<stdio.h>
int main()
{
printf("hello world");
return 0;
}

第二步:按F5运行进行宏定义

cmd /k gcc -o "$(CURRENT_DIRECTORY)\$(NAME_PART).exe" "$(FULL_CURRENT_PATH)" && CLS && "$(CURRENT_DIRECTORY)\$(NAME_PART).exe" & PAUSE & EXIT

How to compile and run notepad in c

按下回车即可出结果

选择保存后可以选择一个快捷键,下次直接按下快捷键即可完美运行!

第三步:完美运行

How to compile and run notepad in c

补充

编译:

cmd /k gcc -Wall -o "$(CURRENT_DIRECTORY)\$(NAME_PART).exe" "$(FULL_CURRENT_PATH)" & PAUSE & EXIT

运行:

cmd /k "$(CURRENT_DIRECTORY)\$(NAME_PART).exe" & PAUSE & EXIT

关于脚本行:cmd /k gcc -o "$(CURRENT_DIRECTORY)\$(NAME_PART).exe" "$(FULL_CURRENT_PATH)" && CLS && "$(CURRENT_DIRECTORY)\$(NAME_PART).exe" & PAUSE & EXIT

cmd /k是弹出cmd窗口并执行后续指令。&和&&表示连接作用,说明有多行指令合为一行。

gcc -o “$(CURRENT_DIRECTORY)$(NAME_PART).exe” “$(FULL_CURRENT_PATH)” 编译生成.exe文件,输出源文件所在目录。注意这里需要有引号,目的是为了在目录及文件名存在空格的情况下也能够正常运行。

&& CLS 清屏。&&的意义在于,前面的语句出现错误,将不会执行该句。

&& “$(CURRENT_DIRECTORY)$(NAME_PART).exe” 运行刚刚生成的.exe文件。如果先前的编译错误,将不会运行。

& PAUSE 暂停,提示”按任意键继续“。这里无论前面有否错误,都将执行。因此我们看到的是编译错误,显示错误信息并暂停的窗口。

& EXIT 退出。

The above is the detailed content of How to compile and run notepad in c. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Installing Notepad  : A Step-by-Step GuideInstalling Notepad : A Step-by-Step GuideApr 25, 2025 am 12:08 AM

Notepad isapowerful,customizabletexteditoridealforcodersandwriters,offeringfeatureslikesyntaxhighlightingandpluginsupport.Toinstall:1)Downloadfromtheofficialwebsite,2)Runtheinstaller,choosingyourlanguageandinstallationoptions,3)Customizepost-install

The Cost of Notepad  : What You Need to KnowThe Cost of Notepad : What You Need to KnowApr 24, 2025 am 12:06 AM

Notepad usage is accompanied by implicit costs of time, learning curve, and productivity losses, but it can be maximized by leveraging plugins, customizing workflows, and combining other tools. Using Notepad may take more time to complete tasks manually, learning its plug-in system and customization functions takes time, and simplicity may lead to productivity loss, but by installing plug-ins such as NppFTP, customizing shortcut keys and interfaces, and combining GitBash and VisualStudioCode, development efficiency can be effectively improved.

Notepad  : Free to Download and Use?Notepad : Free to Download and Use?Apr 23, 2025 am 12:05 AM

Notepad is completely free and open source. 1. It is based on Windows, developed by DonHo, and supports multiple programming languages. 2. Provides syntax highlighting, code folding and other functions, which are lightweight and have low resource consumption. 3. Through macros and plug-ins such as NppExec, tasks can be automated and external commands can be executed. 4. It is recommended to update regularly, explore community resources, and consider other editors according to your needs.

The Notepad   Installation Process: A Detailed ExplanationThe Notepad Installation Process: A Detailed ExplanationApr 22, 2025 am 12:03 AM

Installation steps of Notepad: 1. Visit the official website to download the latest stable version; 2. Run the installation file and click "Next"; 3. Agree to the license agreement; 4. Select the installation path; 5. Select whether to create a desktop shortcut and start menu folder; 6. Complete the installation and start Notepad.

Notepad  : Exploring Pricing and LicensingNotepad : Exploring Pricing and LicensingApr 21, 2025 am 12:12 AM

Notepad is free and open source, and is licensed under the GPLv2. 1. Anyone can use and modify Notepad for free. 2. When used by the enterprise, any modification or extension must be published in GPLv2. 3. The use of commercial products must comply with GPLv2, including public source code.

Notepad  : The Nation Behind the EditorNotepad : The Nation Behind the EditorApr 20, 2025 am 12:08 AM

Notepad originatesfromFrance,createdbyDonHo.1)France'sfocusoneducationandtechnologyfostersinnovation,reflectedinNotepad 'sdesign.2)Theopen-sourceethosalignswithFrenchvaluesofsharingknowledge.3)EfficiencyandperformancearehallmarksofFrenchengineering

Notepad  : Understanding the Financial ModelNotepad : Understanding the Financial ModelApr 19, 2025 am 12:11 AM

Notepad sustainsitselffinanciallythroughdonations,sponsorships,andapluginecosystem.1)Donationsfromusersprovidethemainincome,keepingthetoolfreeandfosteringcommunity.2)Sponsorshipsfromcompaniesofferastableincomewhilemaintainingindependence.3)Apluginec

Accessing Notepad  : Exploring Free OptionsAccessing Notepad : Exploring Free OptionsApr 18, 2025 am 12:07 AM

Free alternatives to Notepad include VisualStudioCode, SublimeText, and Atom. 1. VisualStudioCode supports multiple languages ​​and enhances features through extensions. 2. SublimeText provides an evaluation version, which is fast and has a simple interface. 3.Atom is known for its high customizability and is suitable for personalized needs.

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

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

Hot Tools

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

SublimeText3 Linux new version

SublimeText3 Linux new version

SublimeText3 Linux latest version