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
2010-01-01 13:53:50
Thanks a lot, it solved the problem
2010-01-01 14:01:41
+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
2010-01-01 13:54:18