Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Writing & compiling a C program under Windows XP?

Tags:

c

This is an absolute beginner's question, but per the latest podcast, I understand that no question is too newbie.

I have 0 programming experience and I want to learn C, so I'm starting the K&R book. I am using a Windows XP laptop, and I am planning on using Notepad++ to write, and Code::Blocks to compile.

Here's my question: once I have written the "hello world" program in Notepad++, how should I save it, compile it, and run it?

Edit & new question: When I build & run from Code::Blocks, I get the prompt window with the "hello world" message. It stays open until I close it manually. However, when I double click the .exe file, the prompt just flashes and disappears, why is that?

Many thanks,

JD

Edit: I'm going to use Code::Blocks as an IDE, per the recommendations here.

like image 400
JDelage Avatar asked May 15 '09 13:05

JDelage


1 Answers

Save it as a .c file. And you can use the MinGW compiler to compile the file into an .exe file. But since you have Visual Studio, you should use that compiler.

like image 110
Ólafur Waage Avatar answered Nov 12 '22 14:11

Ólafur Waage