Home > Development Tools > notepad > body text

How to write c using notepad

藏色散人
Release: 2019-11-06 09:57:34
Original
4244 people have browsed it

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;
}
Copy after login

4: Menu bar--"Run--"Run, enter in the pop-up box:

cmd /k g++ -o $(NAME_PART).exe "$(FULL_CURRENT_PATH)" & PAUSE & EXIT
Copy after login

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
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!