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?
使用.c文件扩展名而不是.cpp ,默认情况下,在C / C ++ Visual Studio项目中,这些文件将被编译为纯C代码。
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.)
Try using /TP
/TC
compiler flags, you can find them in compiler group of project settings. Flags are documented here: MSDN .
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.