You are viewing the article How to Run C Programs in Command Prompt at Lassho.edu.vn you can quickly access the necessary information in the table of contents of the article below.
This article is co-authored by a team of editors and trained researchers who confirm the accuracy and completeness of the article.
The wikiHow Content Management team carefully monitors the work of editors to ensure that every article is up to a high standard of quality.
This article has been viewed 3,047 times.
If you’ve written or downloaded some C programming language code on your Windows PC, you’ll need to compile it to turn the code into a program you can run. This simple wikiHow will walk you through the steps of compiling and running a C program from the Windows command prompt using MinGW, an easy-to-install version of the GCC compiler.
Steps
- Download MinGW from https://sourceforge.net/projects/mingw.
- Double-click the downloaded file and follow the on-screen instructions to prepare for the installation.
- When you reach the MinGW Installation Manager window, you will see many installation packages in the upper right pane.
- Check the boxes next to “mingw32-base” and “mingw-gcc-g++.”
- Click the Installation menu and select Apply Changes .
- Click Apply .
- Press the Windows key and type environment . Click Edit the system environment variables in the search results.
- Click the Environment Variables… button.
- Select the “Path” option under “System variables” and click Edit…
- Click New .
- Type C:MinGWbin and click OK .
- Click OK and OK again.
- After the command prompt window opens, double check that the compiler is properly installed (and that the environment variables are set) by executing the gcc -- version command.
- If a command prompt window is open, close and reopen a new window to display the path you added earlier.
- Replace filename.c with the file name containing the C code, and filename.exe with the name you want to give the program after compiling.
- Check to make sure that the program name you set has the extension .exe .
- The -o flag specifies the output file.
This article is co-authored by a team of editors and trained researchers who confirm the accuracy and completeness of the article.
The wikiHow Content Management team carefully monitors the work of editors to ensure that every article is up to a high standard of quality.
This article has been viewed 3,047 times.
If you’ve written or downloaded some C programming language code on your Windows PC, you’ll need to compile it to turn the code into a program you can run. This simple wikiHow will walk you through the steps of compiling and running a C program from the Windows command prompt using MinGW, an easy-to-install version of the GCC compiler.
Thank you for reading this post How to Run C Programs in Command Prompt at Lassho.edu.vn You can comment, see more related articles below and hope to help you with interesting information.
Related Search: