Running C and gcc in Windows (XP)
If you’ve been conditioned that coding and running C codes in Windows is nearly impossible, think again. It’s actually as easy as X-Y-Z (c’mon people, A-B-C is so yesterday).
- Download Dev-C++
- Install the software
- Go to File > New and do your thing
- Execute > Compile (Ctrl+F9)
- Execute > Run (Ctrl+F10)
If you’re familiar with gcc and is more comfortable using it, then follow the steps below:
- Locate your Dev-C++ installation directory
- Go to System Properties (via Control Panel or by right-clicking My Computer) and jump to the Advanced tab
- Click on Environment Variables
- Locate the Path variable and click Edit
- Put a semicolon (separator) at the end of the Variable value
- Add [Dev-C++ directory]/bin
- Finish with an OK
You can now go to the Command Prompt to execute your C codes. In order to do so, you must be in the directory (folder) where your file is saved.
>gcc -o executable.o filename.c
AN: Although Dev-C++ offers convenience in compiling and running, it apparently immediately closes the Command Prompt window after running the code without you getting the chance to see the output. In such case, you’ll have to add a system(“pause”); at the end of your code.