Notepad ++ works with mingw to compile and run C and C ++ programs

Source: Internet
Author: User

1: After mingw and GCC compiler are installed, of course mingw is the safest to install and won't be too difficult.

2: Install notepad ++. Needless to say

3: Configure environment variables (Note: it may take effect after restart)

Computer --> properties --> advanced system settings --> environment variable --> Add C: \ mingw \ bin to system: path;

Of course, mingw is installed under drive C and modified according to different paths

4: Open notepad ++, write a 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;

}

5: Choose menu bar> RUN> Run. In the pop-up box, enter:

CMD/K g ++-O emerge (name_partcmd.exe "$ (full_current_path)" & pause & Exit

Select the shortcut key and save it as: G ++ compilation. Note that the shortcut key should not be repeated. Click Run in the pop-up box, OK, close notepad, and then open notepad ++;


6: Choose menu bar> RUN> Run. In the pop-up box, enter:

CMD/K "$ (name_part)" & pause & Exit

Similarly, the SAVE name is changed to: G ++ run, and then click Run program to execute

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.