Home >Development Tools >notepad >How to write c using notepad
How to write c using notepad?
notepad Compile c:
1: Install MinGW and GCC compiler
2: Configure environment variables (Note: You may need to restart It will take effect later)
Computer-->Properties-->Advanced system settings-->Environment variables-->System: add C:\MinGW\bin;
Of course, MinGW is installed under the C drive and can be modified according to different paths
Recommended: "notepad usage tutorial"
3: Open Notepad, write a piece of C code and save it
For example:
#include <iostream> using namespace std; int main(){ int a, b; cout<<"Input:"<<endl; while(cin>>a>>b){ cout<<a+b<<endl; } return 0; }
4: Menu bar--"Run--"Run, enter in the pop-up box:
cmd /k g++ -o $(NAME_PART).exe "$(FULL_CURRENT_PATH)" & PAUSE & EXIT
Select the shortcut key and save it as: G compile, note Do not repeat the shortcut keys. Click Run in the pop-up box, Ok, close Notepad, and then open Notepad;
5: Menu bar--"Run--"Run, enter in the pop-up box:
cmd /k "$(NAME_PART)" & PAUSE & EXIT
Similarly change the save name to: G run, then click run and the program will be executed
The above is the detailed content of How to write c using notepad. For more information, please follow other related articles on the PHP Chinese website!