macro tracking for debuggingThe ANSI standard specifies five predefined macro names:_ Line _ (two underscores), corresponding to % d_ File _ corresponds to % s_ Date _ corresponds to % s_ Time _ corresponds to % s_ Stdc _
Usage of "#" and "#" in macro:Use # To convert macro parameters into a string, and use # to combine two
Label: Ar use SP data on code BS amp ef
Container_of Macro Analysis// The macro is located in include/Linux/kernel. h.
1. Define the format
/**
* Container_of-cast a member of a structure out to the Containing Structure
*
* @ PTR: the pointer to the member.
* @ Type: the type of the container struct this is embedded in.
* @ Member: the name of the member within the struct.
*
*/
# Defin
#include #define F (A, b) a# #b #define g (a) #a #define H (a) g (a) int Main () {printf ( " %s\n , H (f (1 , 2 %s\n , G (F (1 , 2 return 0 ;}How to expand the rules for a macro function: when the current macro function is expanded, if the parameter has # or # #则不进行宏参数的展开, expand the macro argument first, and then expand the current
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
How to Use macro definition in C LanguageExplanation of macro replacement in C LanguageFirst, let's look at the following question:# Include
# Define PRINT_CLINE () printf ("% d ",______)
Int main (void)
{
PRINT_CLINE ();
PRINT_CLINE ();
Return 0;
}
Fill in the appropriate code at the horizontal line so that the output of the above Code is 34.
I think most people do not have a c
Generally, there are not many built-in macro packages for software such as texlive installed in Linux, and many macro packages have been installed several years ago, in this way, it is often possible to compile the tex files on the Internet in the near future ~ Of course, you can put the macro package on the Internet directly to the tex file directory... generall
#, # @ And \ symbols in the macro definition of C LanguageSource: Liu shihui Rubby logs
1. # (stringizing) string Operators
Purpose: Convert the input parameter name in the macro definition to a parameter name string enclosed by a pair of double quotation marks. It can only be used in macro definitions with input parameters, and must be placed before the paramet
Macro _ va_args _ of variable parameters in C Language __
1 .#
If you want to include macro parameters in a string, ansi c can do this. In the macro replacement section of the class function,
# The symbol is used as a preprocessing operator to convert the language symbol into a string.
For example, if X is a macro pa
1. Add a trace statement to MFC
2. In tools> MFC tracer, select enable tracing and click OK.
3. debug and run go (F5) (Note: not execute '! 'The reason why we couldn't see trace content in the past is that it wasn't debugging, '! ', Remember, remember)
4. The trace content will be displayed in the debug window in the output. The debug execution will automatically jump from the build window to the debug window, where the trace content will be displayed, ^_^
The following is a detailed description
工欲善其事, its prerequisite.Before you formally implement all the cool features and UI, getting ready is the only way to improve the efficiency of your next development.So, this series, I am not in a variety of heap technology, more attention is "Bing" before the "grain line", some cumbersome, but when the whole context is clear, the follow-up work is only on the good Foundation and framework of unlimited expansion and optimization.Macro definition is an effective tool for improving efficiency in th
This article only mentions 2007, but 2010 can also be solved by this method!
Word2007 prompt Error "This error is usually caused by macro security settings"
Every time you run Word, a prompt window appears-"This error is usually caused by macro security settings." If you know that the macro is from a source that you trust, you can change the
To write a good C language, a beautiful macro definition is very important. Macro definitions can help us prevent errors, improve code portability and readability, and more.In the software development process, there are often common or common functions or code snippets that can be written as functions or encapsulated as macro definitions. So is the function good
Replacing macros with Inline:
1. inline functions can be debugged at runtime, but macro definitions cannot;2. the compiler checks the parameter types of inline functions for security or automatically converts the types (same as normal functions), but the macro definition does not;3. inline functions can be member variables of the callback class, while macro-defin
Many people must know about macros and may have used macros. What is Macros? A macro is a program compiled by VBA. It is a series of commands and functions stored in the Visual Basic module and can be run at any time when the task needs to be executed. How to start learning VBA? This is one of the frequently asked questions of many friends. I personally think that the best way to learn something is to start with interest. This is why this post is crea
*) (port)) = ((Byte) (val))#define OUTPW (Port, Val) (* (volatile word *) (port)) = ((Word) (val))#define OUTPDW (Port, Val) (* (volatile DWORD *) (port)) = ((DWORD) (Val)))19: Debug with some macro trackingThe ANSI standard describes five predefined macro names. They are:__line____file____date____time____stdc____cplusplus is also defined in C + +.If the compiler is not standard, it is possible to support
Replace macros with inline:
1. Inline functions can be debugged at run time, while macro definitions are not possible;2. The compiler will do security checks or automatic type conversions (with normal functions) on the parameter types of the function, while the macro definition will not;3. The inline function can access the member variables of the class, and 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.