What is the use of _ _ cplusplus in c language
This article mainly introduces the use of _ _ cplusplus in c language. It is very detailed and has certain reference value. Friends who are interested must finish reading it.
1. _ _ cplusplus and extern "C" are generally used in pairs. If _ _ cplusplus is defined (the macro is defined by default in the cpp file), it will be compiled in C language.
2. It is unique in C++. _ _ cplusplus is actually C++.
Example
# ifndef _ _ CODERSRC_H__ / * prevent the header file from being repeatedly referenced * / # define _ CODERSRC_H__ # ifdef _ cplusplus / / tell the compiler that this part of the code is compiled in the C language format instead of C++ 's extern "C" {# endif / *. * do something here *.. * / # ifdef _ _ cplusplus} # endif # endif / * end of _ CODERSRC_H__*/ is all the content of the article "what is the use of _ _ cplusplus in c language". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!