It is not convenient to invoke macros by running the Macros dialog box, call macros through shortcut keys, and if you can't remember the macros, add a button.
If the macro is valid only for the current workbook document, I recommend that you add a form command button to the workbook document to invoke the macro:
1. E
->member) *__mptr = (PTR);" means declaring a pointer constant *__mptr the same type as member, and initializing it to PTR. "(Type *) ((char *) __mptr-offsetof (type,member))," means that the address of the __mptr is subtracted from the offset of member in the struct and converted to a type pointer. In fact, the pointer is the entry address of member. Here is a new example of my previous online example, which I hope will help the reader:#include /* * The CONTAINER_OF and Offsetof
variable address;3), code example:typedef struct{int A;Char b;void *c;} off_struct_s; printf (" offset a:%d b:%d c:%d\n", offsetof (off_strcut_s, a), offsetof ( off_strcut_s, B), The end result is: Offset a:0 b:4 c:8CONTAINER_OF Macro Detailed:#define CONTAINER_OF (PTR, type, member) ({\Const typeof (((type *) 0)->member) *__mptr = (PTR); \(Type *) ((char *) __mptr-offsetof (Type,member));})1), the parameter PTR is the memory address of the struct member, type is the struct type definition, mem
buff[1024]; vsprintf (Buff, "a=%d,b=%d,c=%d\n", AP); Formats the value of the variable list to output to the buffer printf ("%s\n", buff); vfprintf (stdout, "a=%d,b=%d,c=%d\n", AP); Print the value of the variable parameter list to the standard output //variable parameters The address of the type int is vsscanf ("10,30,40", "%d,%d,%d", AP); The value of the formatted string, in turn, is entered into the variable parameter variable (buff, vsnprintf, "a=
Popular usage: Each digit of the binary represents a state.
001,010,100 This means three states.
You can combine various states by or | operations.
001|010=011
001|010|100=111
A state can be removed by the operation of the .
111001=110
You can define a combination of such macros as a function parameter
#defineP10x001L//001
#defineP20x002L//010
#defineP30x004L//100
Voidfunc (long) {}
Func (p1| P2);
You can tell if a bit is 1.
Since 001 and XXX have
Anonymous sources close to Microsoft said today that Office 2013 for Windows RT Edition will be available later this year or early next year with arm tablets, which is the first time Microsoft has faced flat-panel publishing office. However, this version has been decided to cancel a number of functions, including macros, Third-party add-ins, and VBA support are discarded, and the reason for this decision is not to affect the battery endurance and reli
From:http://blog.chinaunix.net/uid-675476-id-2076827.html
In SAS macros, strings are enclosed in double quotation marks, but if a string contains special characters such as double quotes or a percent semicolon, a single quotation mark is used to escape the special characters in the string. Like what:%let test = ' A ' is the first character! ';
However, if the string contains single quotes, the above method is invalidated. So more generally, SAS provi
Templates and macrosSome days ago, when the Forum was hitting a storm, someone came up with the conclusion that the template is essentially a macro. As a result, you have had a good debate. I originally wanted to join the debate, but I thought everyone's remarks had covered my ideas, so I did it.Although I did not participate in the discussion, the question "What is the relationship between templates and Macros?" is always on my mind. Every time I rel
Author: Kevin Lynx Source: C ++ blog
From: http://www.kuqin.com/language/20080319/4797.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 generate code for us. If the template can generate various types of code (type replacement) for us ),In fact, macros can generate new Code (replaceme
Tn059: Using mfc mbcs/Unicode conversion macros
The following technical note has not been updated since it was first defined ded in the online documentation. as a result, some procedures and topics might be out of date or incorrect. for the latest information, it is recommended that you search for the topic of interest in the online documentation index.
This note describes how to use the macros for MBCS/Un
| _ ioc_write (bidirectional ).The kernel defines the _ IO (), _ ior (), Iow (), and _ IOWR () macros to help generate the above cmd. The following describes the implementation of _ IO (). Others are similar:
You can see the definition of _ IO () in ASM-generic/IOCTL. h.:
# DEFINE _ IO (type, NR) _ IOC (_ ioc_none, (type), (NR), 0)
Let's look at the definition of _ IOC ().:
# DEFINE _ IOC (Dir, type, NR, size )\(DIR) (Type) (NR) (Size)
It can be see
description in section 6.10.3.1 of the standard is still clear, and it writes as follows:
after the arguments for the invocation of a function-like macro have been identified, argument substitution takes place. A parameter in the replacement list, unless preceded by a # Or # preprocessing token or followed by a ## preprocessing token (see below), is replaced by the corresponding argument after all macros contained therein have been expande
Three macro tools I used in vc6
Favorites
New article: Status Bar (3/3)-teststatusbar. Java implemented in Java | old article: Create a class for the filefilter object used by jfilechooser implemented by RegEx
AlthoughHowever, the time to use VC is not short, but I recently noticed that the VC can also customize macros, such as Word and execel. I wrote the following three, which has a good effect and can greatly prolong the service life of the keybo
declare_dynamic macro to the Class header file, and then include this module in all. cpp files that need to access part class objects. If delcare_dynamic and implement_dynamic macros are used as described, you can use the runtime_class macro and cobject: iskindof function to determine the object class during running time. If declare_dynamic is included in the class definition, implemetn_dynamic must be included in the class tool.
Declare_dyncreateDec
1. Question:
C ++ rtti lacks some runtime information and cannot directly create an object based on the object name. To achieve serialization, MFC constructs its own rtti information from the ground up and defines a set of macros. For details, refer to the implementation of the following classes and Macros in the MFC source generation:Cruntimeclass, cobject, declare_dynamic, implement_dynamic
2. Requirement
Some predefined macros are specified in the C standard and are often used in programming. The following table lists some predefined macros that are frequently used.
_ Date _ Date of preprocessing (string text in the form of "Mmm dd YYYY)
_ File _ represents the string Text of the current source code file name
_ Line _ represents the integer constant of the row number in the current source code.
_ Time _
macro to the Class header file, and then include this module in all. CPP files that need to access part class objects. If DELCARE_DYNAMIC and IMPLEMENT_DYNAMIC macros are used as described, you can use the RUNTIME_CLASS macro and CObject: IsKindOf function to determine the object class during running time. If DECLARE_DYNAMIC is included in the class definition, IMPLEMETN_DYNAMIC must be included in the class tool.DECLARE_DYNCREATEDECLARE_DYNCREATE (c
)__attribute__((aligned (n)))To align the structure members to the natural boundary of n Bytes. If the length of a member in the structure is greater than N, the maximum member length is used for alignment.4)__attribute__ ((packed))Cancels the optimization alignment of the structure during compilation and alignment according to the actual number of bytes occupied.The first method above n = 1, 2, 4, 8, 16... is more common.
#define CACHE_ALIGNED __attribute__((aligned(CACHE_ALIGN_SIZE)))3.
Variab
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.