Can I install Visual Studio 2010 Professional as an ID environment for C?

Not C ++, not C #, just old C for my computer science class.

I see options for C #, F #, Visual Basic, and Visual C ++, but if there is an easy way to get it to work with C, I don't see it.

* "as an IDE" in this case means using Visual Studio to compile, debug and run written programs through VS2010, just as I used it before for programming in C #.

+4
source share
3 answers

Create an empty C ++ project.

Bring the properties of the project by right-clicking on it in the solution explorer and selecting "Properties".

Overview of configuration properties → C / C ++ → Advanced.

Switch the Compile As property to "Compile As C (/ TC) Code". This will compile all source files as C.

See also the / TC compiler option: http://msdn.microsoft.com/en-us/library/032xwy55%28v=VS.71%29.aspx .

+3
source

Nothing special is required. Just write your code in the .c source file instead of the .cpp file. Project templates create .cpp files, just rename them with the right mouse button + rename.

+5
source

Just specify the file names with the extension .c, they will be compiled as C. In addition, you can specify that a particular file should be compiled as C (regardless of the file name extension) in the project settings. Nothing more to do.

Note that one annoyance of this IDE is that its syntax highlighting (and some others) is for C ++. It will highlight C ++ keywords in C code, which is pretty annoying. Functions such as IntelliSense also do not work properly with C ++ keywords in C code.

+2
source

All Articles