tags:

views:

102

answers:

3

I have installed visual studio 2008 and i want to create some simple applications using C language. I do this by creating c++ console applications but i want the compiler to work for C not C++. Any way to accomplish this or i need another compiler if i want to deal with C?

+5  A: 

Use .c file extension instead of .cpp, those files will be compiled as C-only code by default in a C/C++ Visual Studio project.

Klaim
Thanks a lot, it solved the problem
+3  A: 

Just create files ending with .c instead of .cpp - MSVC will run the C compiler on them automatically. Note that it also allows you to intermix C and C++ freely (in different files, of course), as long as you stick to the rules (extern "C", etc.)

Eli Bendersky
Correct answer, +1.... :)
Prasoon Saurav
+2  A: 

Try using /TP /TC compiler flags, you can find them in compiler group of project settings. Flags are documented here: MSDN.

Dmitry