We all know that using macros is not only convenient, but also can improve development efficiency. Here's a summary of some of the common macros in the iOS development process that will continue to be added.
Objective-c
Whether the string is empty #define KSTRINGISEMPTY (str) ([str iskindofclass:[nsnull class]] | | |-str = NIL | | [STR length]
1. Define macro for Dimension class
DimensMacros.h
//status bar height
#define Status_bar_h
1. Recognizing
The variable length parameter is a special parameter form of the C language, such as the following function declaration:
int printf (const char *format, ...);
Such a declaration indicates that the printf function can append any number of arguments, any type of argument, except for the first argument type, which is a const char*.
The implementation of printf, for a rough example.
Assuming that Lastarg is the last named parameter of a variable-length parameter function (for example
Turn from: http://blog.csdn.net/norains/article/details/5935279
//=====================================================================TITLE:STM32F10X_XX macro-defined selectionAUTHOR:NorainsDATE:Tuesday 12-october-2010Environment:KEIL MDK 4.0Redcow Board//=====================================================================
If you use Stm32f10x_stdperiph_lib, you will find that there is a section of code in the Stm32f10x.h file about
Macro definitions often appear in the C + + code, in the form of "#define * * *". There are also "macro variables" in Java, but another form.
Final is a keyword in Java that is used to modify classes, member variables, local variables, and methods to represent immutable. When final modifies a variable, the variable is already specified as an initial value, and the variable is determined at compile time, th
in her platform can be compiled through. Her platform is VS2012, and my platform is VS2010. Is it really a platform problem? I googled it and found that the common solution was to add the following header file
#include
I tried and found no way, or there is red line below. Looking for a long time, finally found the max and Min macro definition of the header file "Stdlib.h." I opened this file and the relevant paragraphs are as follows
/* Minimum and
1. As a macro function, you don't need to enclose character values in quotation marks as Step functions.One-on-which macro language is different from SAS language is macro-variable valuesbe always text, quotatio n marks is not needed to indicate TEXR constants in the macro language. EXAMPLEDsid=open ("sasuser.houses"
SolidWorks two times development -01-record a macro
First step:
We need to record a macro ourselves and then see what code the program produces. That's what I did when I was learning Excel. Just, SolidWorks to be more complex, directly recorded macros can not be used, need to make some adjustments. In the absence of experience we'd better follow the advice below.
Edit or Debug SolidWorks
Macro definition in C # define usage,
# Define is a macro definition Command provided in C language. Its main purpose is to provide programmers with some convenience in programming and improve the program running efficiency to a certain extent, however, when learning this command, students often cannot understand the essence of the command, and there is always some confusion here. The command is misused dur
1. Macro definitions can be divided into 2 types:Macro definition with no parametersMacro definition with Parameters2. DefinitionGeneral form#define Macro Name stringLike #define ABC 10.The string on the right can also be omitted, such as # define ABC3. RoleIt is used to define constants by replacing all "macro names" in the source program with the right "strings
A macro with parameters defines a format that resembles the following:"#define Directive----macro with parameters" #define identifier (x1,x2,......, Xn)Where x1,x2,...... xn is a marker (the parameter of the Macro)Note: There is no space required between the name of the macro and the Parentheses.If there are spaces, pr
Table of Contents
1. Introduction
2. Usage
3. Parameters and Variables
4. Precautions
4.1. Macro can only be used for the following three kinds of variables:
4.2. Relationship with Block:
5. Reference documentation
1 IntroductionJINJA2 is the template engine for Python, and in the process of writing Python web use, it is found that macro can save a lot of
Now many friends in writing documents like to download various templates online to simplify their work. However, there are some "black sheep" in the network template that are not produced for the convenience of everyone, they carry a macro virus. Macro virus parasitic in templates or documents, when you run the document or template will activate the virus to harm the computer. But do not worry too much, we
Process_thread_ hello_world_process }The statement in the back defines a process variable hello_world_process, and assigns the initial value, which is handled by strname to simplify.In summary, the processmacro definition, which has two functions, declares that the process executes an entity function and defines the processes structure body variable as follows:Static Char process_thread_hello_world_process(struct pt *process_pt, process_event_t ev, process_data_t data); st
", that is, "Macro", in Word, the use of macros can be a hot key to complete the multi-step operation, users can write their own scripts, but the macros in Word are limited to use in Word.
If you want to use a hotkey instead of a multi-step keyboard or mouse operation, we can use software such as the "Key Wizard" to implement, figure 1 is the "Key Wizard" interface.
screen.width*0.7) {this.resized=true this.width=screen.width*0.7; this.alt= ' Click
macros, such as a macro Ptrtype is also used to rename a type, which is implemented as follows: #define PTRTYPE (_t, _name) typedef _t _NAME; But the practical results are: Ptrtype (void (int), PTR)//compilation not passedPtrtype (void (*) (int), PTR)//compilation not passedPtrtype (int, Ptr)//This is possible.typedef void (*PTR) (int);Ptrtype (PTR, PTR)//this is possible. So is there a way to make the above macr
Original address: C + + library research notes--macro definition of function name
6.47 Function Names as strings:http://gcc.gnu.org/onlinedocs/gcc/function-names.html
GCC provides three magic variables that hold the name of the current function, as a string. The "A" is __func__, which are part of the C99 standard:
The identifier __func__ is implicitly declared by the translator as if, immediately following the opening brace of each Fu Nction definit
differences between inline functions and macro definitionsInline functions can speed up the program when compared to normal functions because no interrupt calls are required, and inline functions are embedded directly in the target code at compile time, and the macro is simply a replacement.Inline functions need to be checked for parameter types, which is the advantage of inline functions and
When you use a macro, enclose each parameter in parentheses and enclose the overall definition of the macro; In general, do not use the self-increment or decrement operator in a macro.
[1] Maximum value
#define MIN (x, Y) (((x)
Ask the lesser of the two
#define MAX (x, y) ((x) > (y))? (x): (y))
Ask the larger of the two
#define MAX3 (X,Y,Z) max (Max (x,y),
MASM (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 and in the DOS era. Although the compilation under win32 is mentioned, it is not
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.