In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article is about why only one parameter is added after # define in C #. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
# define only adds the interpretation of one parameter
There are:
# ifndef _ _ STDIO_H # define _ _ STDIO_H
What does this _ _ STDIO_H stand for? The use of define is not followed by two strings, but it only adds a string here, what does it mean?
There are also many header files with the following statements
# if _ _ STDC__ # define _ Cdecl # else # define _ Cdecl cdecl # endif
What does _ _ stdc__,cdecl stand for?
For example, you # include enter a stdio.h, and then # include enter a string.h. Maybe include stdio.h in the string. H header file. In this way, you will include two stdio.h in your program. Two printf functions are defined and so on.
This is troublesome, compilation will go wrong, even if compiled, it is a waste of resources
Add a # ifndef _ STDIO_H. If you try to include stdio.h again in the string.h in # include, because the macro _ STDIO_H has been defined in the first stdio.h. So if the condition # ifndef _ STDIO_H is not met, it will not be compiled a second time.
It is not necessary to add two strings after # define. One is fine, plus a string such as # define _ STDIO_H, # define DEBUG, etc., which is usually used as a switch before compilation. Control the compilation part. The header file mentioned above is an example. Give me another example of error checking.
# define DEBUG... # ifdef DEBUG fprintf (stderr, "Debug Message\ n"); # endif...
When your program is complete. You can block out the # define DEBUG line with comments. In this way, the debug part will not be compiled at compile time.
What does it mean to add a noun directly after # define in C #?
Define the macro and replace it with an empty string (that is, delete) during preprocessing.
The main purpose of this is to mark something so that the program reader can clearly mark the meaning of the tag without affecting the compiled source code.
Thank you for reading! This article on "Why only one parameter is added after # define in C#" is shared here. I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.