Compiler for C in WIN

Dear fellows,

I have a desktop at home, with XP home edition. I wanna run my C programs in this computer. Where can I download a C compiler or whats the best C compiler for windows.


Who is Participating?
billtouchConnect With a Mentor Commented:
Borland's very well known c/c++  compiler is available in the command line version free at:

There is no GUI, but most popular editors let you configure them for compiles. This is the best optimizing c/c++ compiler available for the windows environment.

This compiler will compile you code as c if the extension is ".c" anb c++ if the extension is ".cpp".


Personally I like Dev-C++ ( It uses the Mingw compiler (ported GCC), and it's free.
You can check Miracle C Compiler also
The eGuide to Automating Firewall Change Control

Today’s IT environment is constantly changing, which affects security policies and firewall rules. Discover tips to help you embrace this change through process improvement & identify areas where automation & actionable intelligence can enhance both security and business agility.

deepu chandranCommented:
>> whats the best C compiler for windows

The Best one for windows is MS Visual C++ compilar.

freebuddyAuthor Commented:

but I have my source code written in C, how can  I ge a C++ compiler then. Or does it also translate C code?
>> but I have my source code written in C, how can  I ge a C++ compiler then. Or does it also translate C code?

This may start an argument but... C and C++ are really the same language. C++ is a newer version of C with extra features/capabilities. Consequently, C++ can be considered a superset of C and all valid C code is valid C++ code.

This is a slight oversimplification but, generally speaking, it's true.
>> This may start an argument but...

Only a small one :)

>>  ...all valid C code is valid C++ code.

This is not true.  Here is a simple example of valid C code that will generate an error when compiled with a standards compliant C++ compiler:

#include <stdio.h>

void main(void)
   printf ("Hello World\n");

C++ requires that main() return int.  C has no such restriction.  This is not the only way the two languages differ but it's the one I can think of off the top of my head.  
I've had this argument before. For some reason, which I don't fully understand, this topic can spark "holy wars" among programmers. In response to your example, main returning void is inherently dangerous. I think you'd find that the C standard would have eventually forbid main returning void if the issue hadn't been taken care of in the C++ standard. That isn't so much a difference in the languages as a flaw in the C standard that was corrected during the jump to C++.

I didn't mean to say that the languages didn't differ, because they clearly do. C++ offers expanded capabilities and with that comes a few added restrictions. As I said, my statement was a slight oversimplification. My point was and remains that, in general, C++ can be conceptuallized as a superset of C.
freebuddy - are you writing C code to the 1989 standard or 1999 standard?  If you are writing to the 1999 standard, then there is only one choice: gcc (dev-C++ if you want a GUI with it).  If you are writing to the 1989 standard, take your pick from

A warning about the latest Microsoft compiler - you will get tons of warnings.  I don't know what standard they're following but almost every standard C procedure call involving char* has been deprecated.  They also have support for something called managed code but that is just for the C++ side.

There is no best compiler: just like there is no best language or best computer.  Every one has its own quirks, good bits, faults and bad bits.  Some like CodeWarrior switch the positions of the OK and Cancel buttons.  Microsoft generates CLR unless you force it to go native.  If you're not fussy, you could try the Borland Museum.   TurboC was a pretty good 16-bit compiler.
Use Microsoft's Visual C++ Studio Express:

This is free and will handle C and C++ and provides all you might expect of a powerful dev environment.

No holy wars here, just some healthy/friendly discussion :)

When the C++ standards committee laid down the rules for C++ they tightened up some of the sloppy loose ends in the C language.  In most cases programs wriiten in C and compiled with a C++ compiler will work but there are exceptions.
Indeed. There are exceptions to every rule.

freebuddy asked if a C++ compiler translates C code to C++ prior to compilation. I was trying to make a general point that would help him/her better understand the difference between the two languages. C++ doesn't need to translate C code to C++ because C code is valid C++ code, with some minor exceptions.

The point is, why bother pointing out obscure differences between these two languages before he/she has an understanding of how remarkably alike they are?
You are correct.  This was not the correct arena to quible about minor differences and wether or not C++ is a superset of C or a derivitive language.

This hijacked thread is now returned to the original poster with my appologies.
let's go open source. Use GCC for the C compiler,

If you are interested in C++, then use g++
All Courses

From novice to tech pro — start learning today.