Home >Development Tools >notepad >How to compile and run notepad in c++

How to compile and run notepad in c++

藏色散人
藏色散人Original
2019-11-04 10:02:4010338browse

How to compile and run notepad in c++

#How to compile and run notepad in c?

1. Download MinGW and store it on the C drive (you can choose this).

Recommendation: "notepad usage tutorial"

2. Right-click "Computer" on the desktop - Properties - Advanced System Settings - Environment Variables, find the Path option, double-click to open, Write ";C:\MinGW\bin" at the end, and use a semicolon to separate it from the previous options (this is how it is written in Win7 system). If it is Win10, please see the picture below:

How to compile and run notepad in c++

How to compile and run notepad in c++

# Then just confirm all the way.

3. Open cmd and enter g -v (note that there is a space).

For Win10 users, if these things appear, it means the modification is successful:

How to compile and run notepad in c++

For Win7 users, if these things appear, it means the modification is successful:

4. Open Notepad and press F5 to open the interface as shown:

How to compile and run notepad in c++

5. Enter

cmd /k chdir /d $(CURRENT_DIRECTORY) & c++ $(NAME_PART).cpp -o $(NAME_PART) &$(NAME_PART).exe

and click Save. Fill in the Name as you like (it is recommended to fill in RunC ), then determine a shortcut key yourself (of course, you can also be unsure, you can find it from "Run" in the menu bar), click OK, and then close the window.

6. Just write a program and press the shortcut key you just set. Will it run?

How to compile and run notepad in c++

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
Previous article:How to open notepadNext article:How to open notepad