They have a common advantage is "change the whole, to avoid the input error" What are the two different? Some.The main difference is that the macro definition is done prior to compilation, and the const is processed during the compilation phaseMacros define constants that do not occupy memory cells and are defined by const occupy memory unitsA macro definition has the same effect as a const constant-----t
MASM macro usage SummaryIntroductionMASM (macro volume ER) is an assembly tool provided by Microsoft. Although it has been around for some years, it still exists in newer tools such as vc.net. Many compilation textbooks take this as an object and show how to use compilation to design a program as a basic course for students in the Computer Science Department. However, the content is basically in version 5.1
Macro definition Simple macroFormat: #define Identifier substitution list#define N 100int a[N];//N就是100Macros with parametersFormat: #define identifier (x1, x2, x3,...... xn) Replace list#define MAX(x, y) ((x) > (y) ? (x) : (y))Note: When the program compiles, it will replace the uppercase identifier with the original expression, so the program will increase at compile time.Advantages or DisadvantagesAdvantages① program may be a little faster② Macros
Macro can be used to implement custom directives, by using custom directives, you can define a section of a template fragment as a user instruction, using the macro instruction syntax in the following format:.........In the above format fragment, the following sections are included:The Name:name property specifies the name of the custom directive and can pass in multiple parameters when using a custom direc
Some of the previous contents content as a student, rarely used, may be working to meet a little more, but the first comprehensive study still do not want to have something to fall, although not commonly used but at least have an impressionThen go to the third chapter "Macro __cplusplus"In code written in C and C + +, we often see the following declaration in the header file:#ifdef __cplusplus extern " C " {#endif // some code #ifdef __cplusplus} #
For example, I want to automatically delete an Excel form after March 2, 2013, and a macro called Macro1 in the table.
Specifically as follows:
Sub Macro1 ()
Private Sub Workbook_Open ()
Application.DisplayAlerts = False
Dim Datee as Date
Datee = #3/2/2013#
If Date > Datee Then
Activeworkbook.changefileaccess xlreadonly
Kill Activeworkbook.fullname
Thisworkbook.close False
End If
End Sub
But this ma
excel2010 How do I record a macro? Everyone has in the use of excel2010 encountered do not know how to record a macro difficulty? Small make up for you to dispel doubts!
1. First open Excel2010 new worksheet.
2. On the Main Development Tools tab, in the code group, click Record Macro.
3. Pop-up "Record Macro
directory of this document
Introduction to preprocessing Directives
One, macro definition without parameters
Second, macro definition with parameters
Description: This C language topic is the prelude to learning iOS development. And for programmers with an object-oriented language development experience, you can quickly get started with C language. If you don't have programming experie
Introduction to preprocessing Directives
One, macro definition without parameters
Second, macro definition with parameters
Description: This C language topic is the prelude to learning iOS development. And for programmers with an object-oriented language development experience, you can quickly get started with C language. If you don't have programming experience, or are no
Http://tech.e800.com.cn/articles/2009/727/1248665385863_1.html
Many C ++ books advise us that C language macros are the first of all evil, but things are not as bad as we think, just like Goto. MacroA major role is to automatically generateCode. If the template can generate various types of code (type replacement) for us ),In fact, macros can generate new Code (replacement and addition of symbols) on the symbols ).
You can find some macro Synt
Whim:In a language to write C + + plug-in, can replace the macro definition,You can do this by adding specific tags to C + +, such as The middle code can be translated into C + + code and compiled with the C + + compiler.Bothered:1.c++ macro must be anti-slash, and then need a lot of repetitive logic code, the need for macros to reduce the amount of code, to achieve efficient work;2. If there is a large num
This article first introduces Linux under the Classic macro definition, feel the wisdom of the geek, and then according to the classic definition for the next blog to pave the groundwork.Offsetof MacroDefinition:Gets the offset of the variable member (MEMBER) of the struct body (TYPE) in this struct. #define OFFSETOF (Type, MEMBER) ((size_t) ((TYPE *) 0)->member)Description: Gets the offset of the variable member (MEMBER) of the struct body (TYPE) in
First look at the macro definition of __user:
#ifdef __checker__# define __user __attribute__ (Noderef, Address_space (1))
As you can see from the macro definition, the __user macro definition is valid under the condition that you configure the __CHECKER__ macro, and it is obvious that the
Macro definition of C Language notes
(1) Symbolic Constants
Macro definition is a replacement strategy in C language, that is, using preprocessing commands # define equals a string of (lengthy) texts with a name (macro, then you can batch use Macros in the source code. In the preprocessing phase, replace the macro in t
There are two types of macro definitions: macro definitions without parameters and macro definitions with parameters.
Macro definition without ParametersThe general format of macro definition without parameters is:
# Define macro
Some people regard macros as the beasts of the flood, and even require them to be completely abandoned from C/C ++. Some people regard macros as the supreme template, which is widely used in logic code. I personally think this is a matter of opinion and wisdom. It is unnecessary to abandon it. Let's look at some classic applications of macro in MFC and ATL, you will find that if you do not use macros to Implement Message ing and object ing, it will ma
C1 condition include
As follows:
Code
# Ifndef main_h _
# Define main_h _
Other content
# Endif
When we see the header file, the function is to prevent this header file from being included multiple times.
Repeated definitions occur when multiple include operations are performed. Therefore, you must use this definition in each header file.
If you still don't know how to use it, you can see the standard header file of C, such as fcntl. h.
2. Conditional compilation
As follows:
Code
# Ifdef _ deb
#springMessage ("xxx") to deal with internationalization:The way spring handles internationalization can be very special, because this tag can be used.This tag is used only after spring has integrated the velocity template. This template is available in:Org.springframework.web.servlet\src\main\java\org\springframework\web\servlet\view\velocity\spring.vmThe first macro in the velocity template is the springmessage tag, and there are other markers, whic
In the book or the novel print, you do not set reverse order printing, then the paper will need to be rearranged, because the first page is placed in the bottom, many words obviously not that time to another one of the tune. Here's how to use the macro method to solve Excel table in reverse order printing.
Start the Excel table and click View-Macro-to record the macro
Macro definition that contains if
When the macro definition contains an IF
1) define the following macros#define DC (P) if (foo (p)) fun (p)
Used in the following environment
if (k>n)
DC (k);
Else
DC (n);
After the macro is replaced, the following
if (k>n)
if (foo (k))
Fun (k);
Else
if (foo (n))
Fun (n);
Visible, the original if and else are no longer paired.
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.