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

Knowledge Point Analysis of C language

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

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

This article mainly explains the "knowledge point analysis of C language". The content of the explanation is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "knowledge point analysis of C language".

I. on the inclusion of header files

Should C language include header files in angle brackets or double quotation marks? Using angle brackets, the compiler looks for the header file under the system path; using double quotes, the compiler first looks for the header file under the current path directory, and if it does not find it, it goes to the system directory to find it. Therefore, it is common to include standard header files in angle brackets and custom header files in double quotation marks. Such as:

Second, on the problem of repeated inclusion of header files

The same header file may be included many times in different C files, resulting in repeated inclusion errors. We can use macro protection to solve this problem, such as the following macro protection in test.h:

The first time a header file is included, the macro _ TEST_H is defined and the code of the "header file" is executed; the second time, because the macro _ TEST_H is already defined before, the code between "# ifndef _ TEST_H" and "# endif" will not be repeated.

This is what the library files in stm32 MCU do, such as

Thank you for your reading. the above is the content of "knowledge Point Analysis of C language". After the study of this article, I believe you have a deeper understanding of the problem of knowledge point analysis of C language. the specific use of the situation also needs to be verified by practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

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

Internet Technology

Wechat

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

12
Report