Export (0) Print
Expand All
5 out of 21 rated this helpful - Rate this topic

How Do I Compile and Link C Code, Not C++?

Give your files the .c extension, for example mysource.c. The Visual C++ compiler automatically assumes that files with the .C extension are C files and not C++ files, and rejects C++ syntax and keywords (such as public, private, and class).

C++ files use the .cpp extension.

See the /TC, /TP compiler options for more information.

See Also

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.