You can not. This is a known bug in Visual Studio. The Intellisense mechanism used to color syntax in Visual Studio is based on the EDG C ++ compiler, which Microsoft bought because its Visual C / C ++ compiler is poorly suited for the incremental parsing necessary to process the "incomplete" code of the incomplete code. And the EDG compiler is only C ++.
You can see an example of this by creating the file foo.c, which compiles as C. Then add the following lines to the file:
#ifdef __cplusplus #error C++ is what I am #else #error A bunch of C code! #endif
When you compile your program, you will see the error message "A bunch of C! Code." But when you look at the Visual Studio editor window, the C side will be grayed out and marked as inactive, and only the C ++ side will be displayed! This is because Intellisense syntax coloring, based on the C ++ EDG compiler, considers all of this to be C ++.
librik
source share