<> The first step : write in c code
#include<stdio.h> int main() { printf("hello world"); return 0; }
<> Step two : Press F5 Run for macro definition

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

* Press enter to get the result
* After selecting save, you can select a shortcut key , Next time, press the shortcut key to run perfectly !
<> The third step : Perfect operation

<> supplement

* compile :
cmd /k gcc -Wall -o "$(CURRENT_DIRECTORY)\$(NAME_PART).exe"
"$(FULL_CURRENT_PATH)" & PAUSE & EXIT
* function :
cmd /k "$(CURRENT_DIRECTORY)\$(NAME_PART).exe" & PAUSE & EXIT
About script lines :cmd /k gcc -o "$(CURRENT_DIRECTORY)\$(NAME_PART).exe"
"$(FULL_CURRENT_PATH)" && CLS && "$(CURRENT_DIRECTORY)\$(NAME_PART).exe" &
PAUSE & EXIT

*
cmd /k It's a pop-up cmd Window and execute subsequent instructions .& and && Indicates connection , Indicates that multiple lines of instructions are combined into one line .

*
gcc -o “$(CURRENT_DIRECTORY)$(NAME_PART).exe” “$(FULL_CURRENT_PATH)”
Compilation generation .exe file , Output source file directory . Note that you need quotation marks here , The purpose is to be able to run normally even if there are spaces in the directory and file name .

*
&& CLS Clear screen .&& What's the point of this , There was an error in the previous statement , The sentence will not be executed .

*
&& “$(CURRENT_DIRECTORY)$(NAME_PART).exe” Run the just generated .exe file . If previous compilation errors , Will not run .

*
& PAUSE suspend , Tips ” press any key to continue “. Here, no matter whether there are mistakes ahead or not , All will be carried out . So what we see is a compilation error , A window that displays an error message and pauses .

*
& EXIT sign out .

Technology