, y = 4 },{X = 0, y = 4}}
-- Print the colorPrint (myPolygon ["color"])
-- Print it again using dot-- NotationPrint (myPolygon. color)
-- The points are accessible-- In myPolygon [1] to myPolygon [4]
-- Print the second point's x-- CoordinatePrint (myPolygon [2]. x)
Program descriptionFirst, create a table. Different from the previous example, In the constructor of the table, there are {x = 0, y = 0 },What does this mean? This is actually a small table, defined in the big table, the small tableT
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
(1) Parameter passing: macros can be easily inherited before the code variables, functions, inline functions are dependent on the parameters and global variables(2) code generation macros and inline function generation are replaced when there is no stack at the time of the function call, so the execution efficiency will be higher than the function, without the risk of stack overflow, but will generate more
You can create 4 auto-run macros in standard modules in Excel, which are Auto_Open (run automatically when you open the workbook), Auto_Close, Auto_Activate, Auto_Deactivate. These autorun macros are reserved for compatibility with EXCEL5 and 95. You can now replace them with the Open,close,activate,deactivate event of the workbook.So, what is a "standard module"? In fact, the module we inserted in the VBE,
Preface:
Over the past few days, I have looked at the ATL interface ing macro, and then I suddenly came up with the idea of writing it. ATL defines many interface ing macros. Several of them are more important, although it seems that it is not necessary to clarify all its details, however, in the process of deep learning, you can also learn other ATL classes by taking a look at the mechanism of the class. It should be helpful. I wrote it according to
Macros and variable parameters
Let's talk about macros today. What? Can macros also be variable parameters? Yes, you have not heard the error. The macro with parameters is the same as the function, and variable parameters are also supported. The following describes a small program.
CPP Code
# Include
# Include
# Define outscreen (MSG,...) printf (MSG ,_
QT Global Macros and variablesQT Global functions and macros are now collected in the work as followsqt_version: (major Detection version Number:Qt_version_check (major, minor, Patch) ((majorWhen you use namespaces, some macro definitions :Namespace Qt_namespace {}//namespace definition# define QT_PREPEND_NAMESPACE (name):: Qt_namespace::name# define Qt_use_namespace using NAMESPACE:: Qt_namespace;# define
First, let's talk about the following content: ##,__ VA_ARGS __, _ FILE __, _ LINE _, _ FUNCTION _, etc.Macro variable:For example, the above macros are used:
#define myprintf(...) printk("[lch]:File:%s, Line:%d, Function:%s," \ __VA_ARGS__, __FILE__, __LINE__ ,__FUNCTION__);
Here # define is used to replace myprintf () with the next large string of content, while the content of... in brackets is copied to the position of _ VA_ARGS _ as is. The fi
ordinal that distinguishes commands.The value in the "read-write zone" in the command code may be _ioc_none (0 value) indicating no data transfer, _ioc_read (read), _ioc_write (write), _ioc_read|_ioc_write (bidirectional).The kernel defines the 4 macros _io (), _ior (), IOW (), and _IOWR () to assist in generating the above cmd. The following analysis of the implementation of _io (), other similar.
You can see the definition of _io () in asm-ge
Original:Begin_message_map (Cmy1dlg, CDialog)//{{afx_msg_map (CMY1DLG)On_wm_syscommand ()On_wm_paint ()On_wm_querydragicon ()On_bn_clicked (Idc_button1, OnButton1)//}} Afx_msg_mapEnd_message_map ()Afx_msg_map, this macro is an auxiliary macro used by MFC to construct a message map table, buried in a class-aware macro or dynamic recognition macroBegin_message_map (Cmy3view, CFormView)//{{afx_msg_map (Cmy3view)Note-the ClassWizard would add and remove mapping
To learn how to develop the Qt plugin, search for QtPlugins or HowtoCreateQtPlugins in QtAssistant to see the manual introduction. Several macro Q_DECLARE_INTERFACE (ClassName, Identifier) Thismacroassociatesthegiv are involved.
To learn How to develop the Qt plugin, search for "Qt Plugins" or "How to Create Qt Plugins" in Qt Assistant to see the manual introduction.
Several macros are involved.
Q_DECLARE_INTERFACE (ClassName, Identifier)
This macro
1. Macros (macro)wording :${buildpageurl (url2,page.pagenum+1,page)}" > (note: This place can directly call the function in the FTL where the macro is located) next page Introduction Method: Invocation Mode:2. Functions (function)notation: Introduction Method:Invocation Mode:${buildpageurl (url2,page.pagenum+1,page)}3. Different placesMacro: Can be returned early, such as But not Macro, the main role is to splice the content, the macro inside the stri
Run Macros in IDE with shortcuts
If you have not renamed a temporary macro, press Ctrl + Shift + P or select "Run temporarymacro" from the "macro" sub-menu on the "tool" menu to run it. However, even if you have renamed it, you can still access it with a shortcut key. Visual Studio. NET provides one or more key associations (or "bindings") to the shortcut key to call the macro method. When you press the key sequence, a macro is executed. The followin
Auto-assign by macroProgramAdd comments .. add comments to each function, class, and file. because I found some of these things are the same. it also takes time to make comments nice and clear. At this time, we can use macros to help us. for example, I have defined two macros. One is to annotate the file (corresponding to the Hot Key Alt + H), and the other is to annotate the function (corresponding to the
In Noip, macros are often used, so here's a look at the definition and usage of macros in C + +
first Usage--match conditional compilation : #define DEBUG
Defines a identifier called Debug. It should be used in conjunction with #ifdef or #ifndef. Examples are as follows:#define DEBUG#IFDEF debugvoid Print (int v) {cout If the symbol debug is present, then the compiler compiles the above prin
Defining some macros using # define, making some neat substitutions, and even some macros with parameters, are common in Linux C code, which means it's good and useful.But it also has some complicated rules and traps to note, and I'll record some of them for reference only.1, when using "\" To change lines, the second line to shelf write, otherwise there will be more than a space. For example:#define OW "Wh
C + +, the macro substitution is written to a string, but runs at a time inconsistent with expectations.Look at the code first:#define _var_arg_20#define _var_arg_40 (+)#define _var_arg_spec (20-30) Char"Target Pin[_var_arg_20]:value[_var_arg_40]:spec[_var_arg_spec]";Compile no problem, when running, the individual macros in STR are not replaced. The first reaction is that the macro is replaced at the time of precompilation, and there should be no
Source: Ios_ Komatsu
Links: http://www.jianshu.com/p/be00c3f3cafd
We all know that using macros is not only convenient, but also can improve development efficiency. The following summarizes some of the commonly used macros in the iOS development process, which will continue to be added.
Whether the string is empty
#define KSTRINGISEMPTY (str) ([str iskindofclass:[nsnull class]
In the driver, the variable cmd that is passed on the IOCTL () function is the value that the application uses to differentiate the contents of the device driver request processing. In addition to distinguishing numbers, CMD contains several appropriate information that can help with processing. The size of CMD is 32 bits and is divided into 4 domains:The Bit31~bit30 2-bit is a "read-and-write" area that distinguishes between a read command or a write command.bit29~bit15 14 bits is the data size
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.