Get the App
SLTechnology News&Howtos  ›  Development  › 

What is the use of _ _ cplusplus in c language

Shulou Source: shulou.com Published: 2022-06-03 08:58:39 11月15日 Update

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!

Tags: Languages languages compilations content files articles code values interests examples guys buddies that is ways are in more formats knowledge compilers industries Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno NVidia Xiaomi Docker Apple MariaDB