Usage of "#" and "#" in macro,1. General Usage
We use#SetMacro ParametersToString, Use##SetTwo macro parameters are combined..Usage:1 # include AllMacro definitionUseful'#'Or'##'LocationMacro ParametersYesNot expand.2.1 Non-'#' and '#' situations 1 # define TOW (2) 2 # define MUL (a, B) (a * B) 3 printf ("% d * % d = % d/n", TOW, TOW, MUL (TOW, TOW); 4 // The Macros in this line are expanded: 5 printf ("% d
6. The instructions for macro actions are not required when you use macros, but you can make macros easier to understand and maintain. You cannot use SQL expressions in the Criteria column of a macro. Typically, the direct execution of a macro is just a test. You can either attach a macro to a form, report, or control
In some cases, you might want to perform one or more actions in a macro only if a specific condition is true. For example, if you use a macro to validate data in a form, you might want to display the appropriate information to respond to some of the record's input values and another to respond to different values. In this case, you can use conditions to control the process of the
Obtain a digital certificate for signing
From a commercial certification authority (CA), a certification authority (CA): A business organization that issues digital certificates, tracks people who are issued certificates, signs certificates to verify their validity, and tracks certificates that have been revoked or expired. Or obtain a digital certificate from an internal security administrator or information technology (IT) professional.
To learn more about the certification authority that pr
Macro virus mainly in Office software office in the presence of the vast number of users caused a large loss. Use the following three strokes to stay away from macro viruses (this article takes word for example).
First trick: Set macro security Level
Open Word and select the tools → options → security → macro securit
A classic example.
The classic example of using preprocessing and macro definitions is to add a header file to prevent the header file from being compiled two times. Imagine this situation, there is a file headerfile.h it is included in the Headerfile1.h, and also included in the Headerfile2.h, there is now a CPP file, Implement.cpp contains Headerfile1.h and headerfile2.h:
#include “headerfile1.h” #include “headerfile2.h”
Suppose a global variable
Application of Variable parameters in macro definition in C Language
In the C standard library, input and output functions of printf, scanf, sscanf, sprintf, and sscanf are variable parameters. When debugging a program, we may want to define a variable parameter output function to record logs. Using a variable parameter macro is a good choice.
InC99A macro can al
There is a macro _ countof in stdlib. H, as follows:
Extern "C ++"{Template Char (* _ countof_helper (unaligned _ countoftype ( _ array) [_ sizeofarray]) [_ sizeofarray];
# DEFINE _ countof (_ array) sizeof (* _ countof_helper (_ array ))}
This macro is used to obtain the size of an array element.
Use:
# Include
Int main ()
{
Int A [5];
......
Int arraysize = _ countof (a); // obtain the size of array.
}
/
Macro diversity
In wireless communication, macro diversity refers to the situation where multiple sending antennas or multiple receiving antennas transmit the same signal, and the distance between these antennas is much greater than the wavelength. In a cellular network or wireless LAN, these antennas can be located at different base stations or access points. Macro
Annotations are indispensable to help others or themselves read their own programs. A beautiful program is not about how advanced the technology you use, but about how easy it is to describe.
In the Java IDE environment-Eclispe, there are many annotations, and setting annotations is also very convenient, because currently C ++, Xi, and Eclispe have been uninstalled, for setting comments, Baidu or Google is the only option.
So I am used to the comments of Eclispe, so I tried to try it in VC6.0. H
The former array carefully re-examined the macro expansion of C. In summary, there are several main rules:
The results of each macro expansion are scanned repeatedly until there are no expandable macros.
Each time you expand a macro, you will remember this expansion, and in the result of the macro expansio
to prevent CSRF and forms are repeated, some systems use token mechanism, specific mechanisms can be self-study, which for our individual testing caused a certain inconvenience. Solution Ideas:1 , will get token the action is set to macro, which automatically completes each re-acquisition token operation (most time-saving, but troublesome)2 , the test phase allows development to token set to a fixed value (most convenient)3 , all tests are used Proxy
Benefits of using Do{}while (0) in macro definitions#define MACRO_NAME (para) Do{macro content}while (0)Format, summed up the following reasons: 1, empty macro definition to avoid warning: #define FOO () do{}while (0) 2, there is a separate block, can be used for variable definition, a more complex implementation. 3, if the m
parameter. 2) Then use the Va_start macro to initialize the variable arg_ptr, the second parameter of this macro is the first parameter of a variable parameter of , is a fixed parameter. 3) Then return the variable parameters with Va_arg and assign the value to the integer J. The second parameter of Va_arg is the type of the parameter you want to return, and this is the int type. 4) Finally, the Va_end
0. PrefaceFrom the beginning of learning C language began to contact Makefile, consulted a lot of makefile information but the total feeling did not really master makefile. Assuming that you write a makefile, you always think it's very exhausting.So deliberately using the blog to summarize the relevant knowledge of makefile. The detailed use of the makefile is illustrated by the sample example.Examples say that makefile is divided into the following sections. For a lot of other content please re
When we use word2010 to do a very repetitive work, we can record it as a macro to use, both convenient and efficient. Today, the small script for everyone to bring WORD2010 record macro operation process, the need for friends can take a look at learning! Introduction to the ingenious use of Word2010 document content controls
Word is a great Office software for word processing, although many other word prod
In the process of writing code, often output some debugging information to the screen, will normally call printf this kind of function.But when debugging is done, we need to manually remove or annotate these places.Recently watching the "Linux C programming One-stop learning" This book, I think of a method:
Copy Code code as follows:
void myprintf (char* fmt, ...)
{
}
#ifdef DEBUG
#define printf (fmt, args ...) myprintf (FMT, # #args)
#endif
Debug phase with Debug
);printf ("%d%d/n", I, j);Return}We can declare our functions in our header file in this way:extern void Simple_va_fun (int i, ...);We can call this in the program:Simple_va_fun (100);Simple_va_fun (100,200);As you can see from the implementation of this function, we should have the following steps with variable parameters:1 first in the function to define a va_list type of variable, here is arg_ptr, this variableQuantity is a pointer to a parameter.2) and then using the Va_start
access| Program | A control macro refers to a collection of one or more actions, each of which implements a specific function, such as opening a form or printing a report. Macros enable certain common tasks to be completed automatically. For example, you can set up a macro that runs the macro when the user clicks a command button to open a form.
A
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.