user33061
user33061

Reputation: 1885

Does the Microsoft Visual C++ Express compiler compile C code?

I'm not sure, will the visual c ++ compiler express edition work for compiling c and if not can someone link me to an easy c compiler to use.

Upvotes: 2

Views: 4512

Answers (6)

Walter Bright
Walter Bright

Reputation: 4307

You can download a free copy of the Digital Mars C compiler.

Upvotes: 2

Ilya
Ilya

Reputation: 3138

Just small clarification - Visual C++ is not a compiler rather an IDE. The compiler will be cl.exe and as many sad there is no problem to compile C code with cl.
But there is other options like Windows ports of gcc or Watcom compiler

Upvotes: 0

David Thornley
David Thornley

Reputation: 57066

Depends partly on what C you're talking about. Visual C++ will happily compile C programs (make sure they've got a .c extension, and make sure the "Compile As" option in the "Advanced" part of the "C/C++" property pages is not set to C++ only), but is missing a whole lot of stuff in the C99 standard. If you're interested in the original standard C, Visual C++ will work very nicely.

Upvotes: 0

Ariel Arjona
Ariel Arjona

Reputation: 172

http://www.bloodshed.net/compilers/index.html

maybe there's something to your liking there.

also there's always gcc: http://gcc.gnu.org/

Upvotes: 1

Michael Burr
Michael Burr

Reputation: 340406

To add to Bill The Lizard's answer - any C++ compiler will compile a file using C language rules if the file has a .c extension. This can be overriden to force a file to be compiled as C or C++ using command line options.

This is done with MSVC using the /Tc or /TC options to compile as C, and the /Tp or /TP options to compile as C++.

Upvotes: 6

Bill the Lizard
Bill the Lizard

Reputation: 405995

Yes, it will work. C is a subset of C++ (for all but a very small number of exceptional cases). Any C++ compiler should work with valid C code.

See the answers to this question for some of the rare examples of C code that isn't valid C++.

Upvotes: 4

Related Questions