Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the use of _ _ cplusplus in c language

2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

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!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report