This article tests three compilers, namely VC, mingw, and GCC, in 32-bit and 64-bit modes. In six cases, the predefined macro values related to 64-bit programming are used. It is of reference significance for cross-platform programming.
Agner fog mentioned some reservation Macros in his calling conventions for different C ++ compilers and operating systems. The following is an excerpt.
Note: The following content is from calling conventions for diffe
C ++ macros and enumeration, enumerationMacro
Our calculator program uses 1234 for addition, subtraction, multiplication, and division, which makes reading a little difficult. After a month, you may not be able to remember whether the code is 0123 or 1234. You still have to search for it in the Code. If you can get a meaningful alias for the four numbers representing the four arithmetic operations, first, you know what it is. No problem. Use
"Hot Questions-Extended learning"
Inline constenum macros
"C + + can use technology to replace macros"The inline of C + + is an improvement to the C function macro, the const substitution macro constants.inline overrides are provided for function macro C + +. try to replace the macro with a const, Enum,inline. --"Effective C + +" clause 2Advantages of macros
Some pre-defined macros in the C standardSome predefined macros are specified in the C standard and are often used for programming. The following table is a list of some of the predefined macros that are often used.MacroSignificance__date__Date of preprocessing (string literal in the form "MMM DD yyyy")__file__string literal representing the current source code f
We encounter many macro definitions during development in the vs environment. These macros can be applied to code or used for compilation, engineering options, and other settings, in short, it is an essential tool in our development, and it is necessary to make a summary. Some macros are defined in C/C ++, and some macros are predefined in the VC environment.
1.
A major function of macros is to automatically generate code for us. If the template can generate various types of code (type replacement) for us, the macro can actually generate new Code (that is, replacing and adding symbols) for us on the symbol ).
1. Macros can be defined like functions.
2. if a macro requires a parameter, you can skip it. The compiler will warn you (the macro parameter is not enough)
From: http://blog.csdn.net/strikebone/archive/2007/11/02/1863523.aspx
Here is a question about macros. I have used ATL's String Conversion macros, including w2a, which I don't quite understand at first. To use these macros, you must use uses_conversion at the beginning of the function to initialize some local variables. Use it, but let's look at the macro defini
1. Macro is a replacement that is completed by the C Preprocessor before compilation.
2. Differences between macro text replacement and typedef:
For example, the difference between typedef int X [10] And # define x int [10]
(1) The macro type name can be extended with other type specifiers, but the type name defined by typedef cannot.
Eg,
# Define peach int
Unsigned Peach I;/* No problem, pai_^ */typedef int banana;
Unsigned banana I;/* error, invalid, */(2) when several variables are declared
The ansi c standard has several predefined macros: __file _ date _ time ___ _ line _.
_ Line __: inSource codeInsert Current SourceCodeRow number;
_ File __: insert the name of the current source file into the source file;
_ Date __: Insert the current compilation date into the source file
_ Time __: Insert the current compilation time into the source file;
_ Stdc __: when requiredProgramWhen the ansi c standard is strictly followed, this id
Excel2003 Tutorial 60, how to record the Macros command in Excel.
Demo Animation
Operation Steps
It's perfectly OK to say, "Macros" is the essence of Excel, how to record a macro?
Let's take a look at the specific recording process by recording a macro with a setting heading "Center Across columns":
Execute the tools → macros → record new Macro comman
Excel2003 Tutorial 57, create a Form command button with macros.
Demo Animation
Operation Steps
It's not easy to call macros by running the Macros dialog box, call macros through shortcut keys, and if you can't remember a lot of macros, let's add a button to the Ex
MacroOur calculator program, with 1234 corresponding to subtraction, is a bit of a hindrance to people reading. After one months to look at this code may not be able to think of 0123 or 1234, but also to find in the code, if you can represent the four number of arithmetic to take a meaningful alias, a look is to know what corresponds. No problem, use a macro. The following is the fifth edition of our Calculator program://define arithmetic macros#defin
program in or out of the compilation commands, such as # if and #ifdef, and usually converts the excluded statement to a blank line.(3) Macro expansionThe preprocessor expands the macro reference that appears in the source program file into the corresponding macro definition, which is what this article describes as the function of # define, which is done by the preprocessor.The source program processed by the preprocessor differs from the previous source program, where the work performed is pur
1. Hybrid macros.
As styles become more and more complex and require repeated use of large sections of styles, using variables cannot achieve our goal. At this time, the mixed macros will be used.
When using a hybrid macro, you must first declare a hybrid macro. When declaring a hybrid macro, there are two types: A Mixed Macro without parameters and a Mixed Macro with parameters.
1.1Declaration of mixed
ZZ from:http://blog.csdn.net/musein/article/details/742609==================================================The __init and __exit declarations is special kernel macros designed to tell the kernel to flag thesefunctions for special handling in cases where they is compiled in statically rather than included asparts of modules.The __init declaration allows the kernel to reclaim the space used by initializationfunctions, while the __exit declaration tells
Compilation: assemblyGuess: So this macro is related to the assembly?!Reference: Some of the constant macros are referenced by both C and ASM, while C and ASM differ in the processing of the immediate number symbol . In ASM, directives are adopted to differentiate whether the operands are signed or unsigned, rather than through the operands. and C is through the property of the variable, not through the operator. c If you want to indicate that a cons
expansionThe preprocessor expands the macro reference that appears in the source program file into the corresponding macro definition, which is what this article describes as the function of # define, which is done by the preprocessor.The source program processed by the preprocessor differs from the previous source program, where the work performed is purely a substitution and unwinding, without any computational function, so as long as you can really understand this when learning the # define
the host with public IP is not exactly the same, for example, some are 1M, some 5M, bandwidth monitoring threshold is the bandwidth value *0.8. For example, 1M bandwidth, the monitoring threshold is 0.8M. (Note: After testing, in the Zabbix trigger this is 0.8M, will not issue an alarm, but the threshold is greater than 1M of the decimal can be alarm, suspect is less than 1M, Zabbix automatically change units to K caused. Then simply define the bandwidth monitoring thresholds by unifying the un
1.Block unused parameters warningSuch a macro was used in Ob_define.h in oceanbase to force the incoming data into void type. #ifndef UNUSED #define UNUSED (v) ((void) (v)) #endifSuch a macro is primarily intended to mask the "unused parameters" warning, as the following function uses two parameters. However, some compilers will report a warning when none is used: they feel that P and mod_id are unused.All of us use UNUSE macros so that two of
1 , variable-parameter functions A number of macros are defined in the header file for functions with variable parameters, as follows VA _list : This type declares a local state variable, assuming that the variable is named va VA _start : This macro initializes the state variable va to call before calling va_arg Span style= "Font-family:wenquanyi Micro Hei" > va_end Va_arg: This macro returns the value of the next pa
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.