First, demand-oriented, small projects, code is not many, version is quite a lot ... You plan to use a macro to control the switch options, and then pass a long string #if #elif ... #endif To control the build version number, but also according to compatibility and minor changes to do the level three version number .... So we need a version number splicing, obviously, it should be the compile time can be done. --------Demand is complete-------- The C-
The function of the # in a macro is to string the macro arguments that follow it (stringizing operator), simply by adding a double quote to the left and right of the macro variable it refers to.The following two statements are equivalent, as defined #define STRING (x) #x .char *pchar = "Hello";Char *pchar = STRING (hello);And a #@ is a single quote (Charizing Ope
1. functions and macros(1) Macros are expanded by direct substitution of preprocessing , and the compiler does not know the existence of macros(2) A function is an entity compiled directly by the compiler , and the invocation behavior is determined by the compiler(3) Multiple use of macros will result in an increase in the volume of the final executable program(4) The function is jump execution, in memory only one copy function body exists(5) The efficiency of the
This article will use recorded macros in Word to solve the problem of garbled text formatting on a copy-and-paste network. This macro code is taken from: Li Wenshu, thank you for his offer.Technorati Tags: Word macro format correction 1. Create a Word macroCreate a new Word file, click View---> Macro---> Record macro,
This blog is original, follow the cc3.0 protocol, reprint please indicate the source: http://blog.csdn.net/lux_veritas/article/details/8977510
Certificate --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Per_cpu macro is very common in Linux kernel. Here, we will analyze the features of the per_
The original Article is here
Variable Parameter macro
Macros can receive variable parameter lists, just like functions. The syntax for defining variable parameters is similar to that for a function. Here is an example:
# Define eprintf (...) fprintf (stderr, _ va_args __)
These macros are called Variable Parameter macros. When a macro is called, all symbols after the first named parameter, inc
Token paste OPERATOR ):##
1. To put it simply, "#" is a separate connection method. Its function is to first separate and then force the connection.
The separator is similar to a space. We know that in the general macro definition, the Preprocessor generally uses spacesThe interpretation component segment flag. If each segment is compared with the previous one, it will be replaced. But the result is,There are some spaces between the replaced segments.
Compare the similarities and differences between parameters with macros and functions
From http://blog.csdn.net/piaojun_pj/article/details/5932639
The compiler processes Macros in the pre-compilation phase of the program. It mainly replaces Macros in the source file with pre-compilation commands.
1. Macros will be replaced simply when the compiler compiles the source code, without any logic detection, that is, simple code replication.
2. When macro
The operating system kernel may be a micro kernel or a single kernel (which is sometimes called a macro kernel macrokernel ). These terms are defined as follows in a similar encapsulation:
Single Kernel: Also knownMacro Kernel. The kernel is implemented as a large process and runs in a separate address space at the same time. All kernel services run in one address space and call functions directly between them, which is simple and efficient. Micro-
1, Problem 2, the solution to the problemChoose Apple LLVM 7.0 under build setting to GUN993. Causes of this problem3.1. The following macro is defined in the NSException.h file/* * Asserts to use in Objective-c method bodies */#If!defined (Nsassert)Using the Nsassert macro#Define NSASSERT5 (condition, desc, arg1, arg2, Arg3, Arg4, Arg5) __pragma_push_no_extra_arg_warnings _nsassertbody (( condition), (DESC
1. Macro definitions can be divided into 2 types:Macro definition with no parametersMacro definition with Parameters2. DefinitionGeneral form#define Macro Name stringLike #define ABC 10.The string on the right can also be omitted, such as # define ABC3. RoleIt is used to define constants by replacing all "macro names" in the source program with the right "strings
A macro with parameters defines a format that resembles the following:"#define Directive----macro with parameters" #define identifier (x1,x2,......, Xn)Where x1,x2,...... xn is a marker (the parameter of the Macro)Note: There is no space required between the name of the macro and the Parentheses.If there are spaces, pr
Table of Contents
1. Introduction
2. Usage
3. Parameters and Variables
4. Precautions
4.1. Macro can only be used for the following three kinds of variables:
4.2. Relationship with Block:
5. Reference documentation
1 IntroductionJINJA2 is the template engine for Python, and in the process of writing Python web use, it is found that macro can save a lot of
Now many friends in writing documents like to download various templates online to simplify their work. However, there are some "black sheep" in the network template that are not produced for the convenience of everyone, they carry a macro virus. Macro virus parasitic in templates or documents, when you run the document or template will activate the virus to harm the computer. But do not worry too much, we
$ (RemoteMachine)Set to the value of the remote computer property on the Debug property page. For more information, see Changing the project settings for A/C + + Debug configuration.$ (References)A semicolon-delimited list of references is added to the project.$ (ConfigurationName)The name of the current project configuration (for example, "Debug").$ (PlatformName)The name of the current project platform (for example, "Win32").$ (Inherit)Specifies the order in which inherited properties appear i
Description$ (RemoteMachine)Set to the value of the remote computer property on the Debug property page. For more information, see Changing the project settings for A/C + + Debug configuration. $ (References)A semicolon-delimited list of references is added to the project.$ (Configuration)The name of the current project configuration (for example, "Debug").$ (PlatformName)The name of the current project platform (for example, "Win32").$ (Inherit)Specifies the order in which inherited properties
the return_instance; the } --(Nsuinteger) Retaincount in { the //can return a special value to remind other programmers the //return maxfloat; About returnUint64_max; the } the the @end + - the #pragma-Macro extraction of single-instance modeBayi //Create a new header file (Singleton.h) the the //you can use Interfacesingleton to replace the person class Singleton class factory method declaration - #defineInterfacesingleton (name) + (
1. Open an empty Excel document first, enter File-options-customize Ribbon, on the rightMain tabs Find developer and tick, so in Excel you will see developer this tab2. Click on the new tab below to create a tab and create a group backup, tab andGroup name can be filled in the desired name, such as tab for May macros,group for productionStatus3. Find the record Macro in developer, specify Marco's name, in the store
In linux/netlink. h, some macros are defined to facilitate message processing. These macros include:
# Define NLMSG_ALIGNTO 4 # define NLMSG_ALIGN (len) + NLMSG_ALIGNTO-1 )~ (NLMSG_ALIGNTO-1 ))
The macro NLMSG_ALIGN (len) is used to obtain the minimum value not smaller than len and the byte align.
# Define NLMSG_LENGTH (len) + NLMSG_ALIGN (sizeof (struct nlmsghdr )))
The macro
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.