Improve company productivity with a Business Account.Sign Up


Compiler for C in WIN

Posted on 2006-10-31
Medium Priority
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
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.

Build your data science skills into a career

Are you ready to take your data science career to the next step, or break into data science? With Springboard’s Data Science Career Track, you’ll master data science topics, have personalized career guidance, weekly calls with a data science expert, and a job guarantee.


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 200 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

The Firewall Audit Checklist

Preparing for a firewall audit today is almost impossible.
AlgoSec, together with some of the largest global organizations and auditors, has created a checklist to follow when preparing for your firewall audit. Simplify risk mitigation while staying compliant all of the time!

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Have you thought about creating an iPhone application (app), but didn't even know where to get started? Here's how: ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Important pre-programming comments: I’ve never tri…
An Outlet in Cocoa is a persistent reference to a GUI control; it connects a property (a variable) to a control.  For example, it is common to create an Outlet for the text field GUI control and change the text that appears in this field via that Ou…
The goal of this video is to provide viewers with basic examples to understand recursion 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.

606 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