Compiler for C in WIN

Posted on 2006-10-31
Last Modified: 2010-04-15

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.


Question by:freebuddy
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
LVL 53

Expert Comment

ID: 17847010
Personally I like Dev-C++ ( It uses the Mingw compiler (ported GCC), and it's free.
LVL 12

Expert Comment

ID: 17847565
You can check Miracle C Compiler also

Expert Comment

by:deepu chandran
ID: 17849273
>> whats the best C compiler for windows

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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.


Author Comment

ID: 17849717

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

Accepted Solution

billtouch earned 50 total points
ID: 17849932
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".



Expert Comment

ID: 17851984
>> 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.

Expert Comment

ID: 17852601
>> 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.  

Expert Comment

ID: 17853566
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.
LVL 11

Expert Comment

ID: 17854092
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.
LVL 15

Expert Comment

ID: 17854106
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.

Expert Comment

ID: 17857843

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.

Expert Comment

ID: 17858911
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?

Expert Comment

ID: 17858971
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.

Expert Comment

ID: 17864312
let's go open source. Use GCC for the C compiler,

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

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preface I don't like visual development tools that are supposed to write a program for me. Even if it is Xcode and I can use Interface Builder. Yes, it is a perfect tool and has helped me a lot, mainly, in the beginning, when my programs were small…
Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode ( They will have you believe that Unicode requires you to use…
The goal of this video is to provide viewers with basic examples to understand how to create, access, and change arrays in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.

630 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question