You can use a macro to define a function that has no return value. For example:
Copy Code code as follows:
#define PRINTMAX (A, b) \ do \ {\ int x = A, y = b; \ printf ("Max:%d\n", x > y x:y); \} while (0)// ... Printmax (3, 4);
Such "functions" are essentially different from functions in real sense, because a macro is a compile-time behavior that replaces text only before it is compiled. In the Python source code, you can often see a macro definition similar to the follow
Preface
Export_symbol macros are used after Linux-2.6, in the Linux-2.4 kernel, the default non-static functions and variables are automatically imported into the kernel space and are not marked with Export_symbol ().
Then, after Linux-2.6, all symbols are not exported by default, so use Export_symbol () to mark them. the role of 1.export_symbol macros The functions or symbols defined within the Export_sym
The concept of macros is no stranger to me, but I never use macros, but I always use procedures (subroutines), because I think the macro will make the program longer, although it executes faster than the calling subroutine. So have been not too cold to the macro, until looking at the program of Lao Luo found a useful macro, it makes the program's writing more concise, intuitive, and beyond the concept of my
VBA and Macros======The beginning of the content sounds very dull, please do not distract, resistance to look down, interest is always slowly accumulated.------------------------------------------------------------------------------1, hand in hand, record a part of their own macroReferring to VBA, I believe many people think of the macro, but VBA and macro is not the same thing? I think they're not the same thing, but it doesn't matter what we're goin
Pre-defined Macros in visual c ++I. Main Objectives
(Because visual studio usually contains many development environments, c/c ++ ide is usually called visual c ++ 20xx)
Sort out the predefined Macros in visual c ++ 2010. Let's take a look at the preparation and understanding. In actual coding, we can consider using some macros as the judgment standard.
Http://ms
In the vs project configuration, you can see that vs provides you with some macros (macros), for example, but you cannot find the place to modify or add macros. After Google search, I found that the built-in macros of vs cannot be modified. Now there is still one problem. Can I add a new macro?
In the WebKit project, y
Macros for WindowsWhen using some new versions of Apis or new control features (such as the new version of comctl32.dll), you may get the error "error c2065: Undeclared identifier. The reason is that these functions depend on your operating system version. The definition in your header file is not up-to-date. (For MFC, It is stdafx. h) The following msdn article describes how to solve this problem and details the
Some object macros are defined in standard C and each compiler. These macros start and end with "_" and are all uppercase characters. these predefined macros can be # UNDEF or redefined.
The _ file __,__ line __,__ data __,__ time __,__ stdc _ Standard predefined macros are defined in the ansi c standard. GCC extends i
Using macros to call DirectX com
Many Microsoft DirectX interfaces define a macro for each method, which makes it easier to use these methods in your application. You will find these macros in the header file of the interface declaration. These macros are designed to be Macros in C and
Vb. NET automatically loads. xla filesPublic Function Loadxla (ByVal xlapath as String, ByVal load As Boolean) As Boolean Dim loaded As Boolean = False T Ry If (file.exists (Xlapath)) then Dim o as Object o = XlApp.AddIns.Add (Xlapath, True) ' defined as Object,add by Danielinbiti o.installed = load loaded = o.installed End If Catch loaded = False End Try Loadxla = Loa
/******************************************************//**************---about Macro----------**************// ---author:tibruce Zhao---**************//**************---date:2015/7/31------**************//*** /#include Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced. "C + + programs" about macros
when neededExecution speed is faster than the normal function.Of course, the inline function also has some limitations. is that the execution code in the function cannot be too much , if, inlinefunction body is too large, the general compiler will discard the inline mode, and the normal way to call the function. (in other words,That is, you use an inline function, just to make a request to the compiler, the compiler can reject your application)In this way, the inline function is as efficient as
Properties ' VBA properties are features of VBA objects ' means of representing properties of an object are ' object. Property = property Value NBSP;NBSP;NBSP;NBSP;NBSP;NBSP;NBSP;NBSP;NBSP;NBSP;SUBNBSP;TTT () Range ("A1"). VALUENBSP;=NBSP;100NBSP;NBSP;NBSP;NBSP;ENDNBSP;SUBNBSP;NBSP;NBSP;NBSP;SUBNBSP;TTT1 () sheets (1). name= "worksheet renamed" endsubsubttt2 () sheets ("Sheet2"). Range ("A1"). value= "ABCD" EndSub NBSP;NBSP;NBSP;NBSP;NBSP;NBSP;NBSP;NBSP;SUBNBSP;TTT3 () range ("A2"). in
(...) to implement queries.Begin_com_map (x) defines an array mapped to the next static interface:_ Atl_intmap_entry _ entries [];Every interface ing macro is actually added to this array. An interface ing macro consists of three partsPoints: The IID number, offset value (most of the time) of the interface, and the function to be executed, which is not required for general interfaces.Execute other functions. _ Getentries () is the returned array. I will discuss some details later.
8: static hre
this method, both c99 and gnu cpp support the following macro definition methods:
#define myprintf(templt, ...) fprintf(stderr,templt, ##__VAR_ARGS__)
In this case, the # connection symbol is used to remove the comma before when _ var_args _ is empty. The translation process is as follows:
Myprintf (templt );Converted:Fprintf (stderr, templt );
In this way, if the templt is valid, no compilation error will be generated.Incorrect nesting-misnesting
The macro definition does not have to have comp
The following macros are briefly introduced:
1) _ va_args _ is a macro of a variable parameter. The macro of this variable parameter is added in the new c99 specification, currently, only GCC is supported (not supported by the vc6.0 compiler ). # Is added before the Macro. When the number of variable parameters is 0, # is used to remove ",". Otherwise, compilation errors may occur.2) _ file _ Macro will be replaced with the current source file name du
file to test the feasibility.========================================================== =================================== Content:========================================================== ==================================
# Include
Compile, run, debug, and finally succeed. It is feasible.Then, the code is split into several files.========================================================== =================================== The declaration is changed to the following:======================
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.