link address: http://blog.sina.com.cn/s/blog_686188ef0100klku.html
# define is a macro definition Command provided in C, the main purpose is to provide some convenience for Program programmers in programming, and to improve the program running efficiency to a certain extent, however, when learning this command, students often cannot understand the essence of the command. It always creates some confusions and misuse it during programming, This
you want to know thisArticleMore details about the things mentioned in. These things can be used as a reference.
Okay. Where can I start? First, we will configure the plug-in that contains the view and add org. Eclipse. UI. navigator to the dependency (dependencies. Then, we use the org. Eclipse. UI. Views extension point to define a view part and use the org. Eclipse. UI. Navigator. commonnavigator class as the implementation class of the view par
Basically, you can use Const,enum or inline to replace a pre-order # define. The main reasons are two:#define Aspect_ratio 1.6531. Pre-processing instructions are preprocessed prior to compilation (GCC-E is preprocessed, its output file is compiled as Gcc-s input), so the compiler is not able to see the symbol Aspect_ratio defined by # define, so it does not appe
1. Const is used for class member variable definition, once defined and cannot change its value. Define defines global constants that can be accessed everywhere.2. Define cannot be defined in a class and const can.3. Const cannot define constants in conditional statementsif (...) {Const FOO = ' BAR '; Invalid}Butif (...) {Def
1. Grammar
Statement:
Parameter data = 8 ' D14;
' Define Data 8 ' D14
Use:Data
' Data
2. Scope
Parameter the file that acts on the Declaration, ' define reads from the compiler until the end of the compilation is valid, or the ' undef command invalidates it.
If you want parameter or ' define to work on the entire project, you can write the following declaration i
In general, we define a constant using # define, #define的本质是文本替换, for example, # define INT_PTR int*, when we use a int_ptr,int_ptr a, B, which is equivalent to an INT * A, A, a, b; That is, define a pointer variable A and integer variable B, which is a common scenario for #
1 NO parameter macro definitionThe macro name of the parameterless macro is not followed by a parameter.The general form of its definition is:#define Identifier stringWhere the "#" indicates that this is a preprocessing command. All that begin with "#" are pre-processing commands. "Define" defines the command for the macro. "Identifier" is the name of the macro defined. A "string" can be a constant, an expr
Note: Define cannot be defined in a class, and the const must be defined in a class, and the const must be accessed by the class name:: Variable name
1. Const is used for class member variable definition once defined and cannot change its value. Define defines global constants that can be accessed anywhere.2, define can not be defined in the class and Const.3. C
Original article address:
Http://blog.csdn.net/kindazrael/article/details/8108868
In C, Preprocessor is a powerful tool that makes your code easier to read and modify. With preprocessing code, you can redefine a part of the code to make your code more suitable for your style. Preprocessor is processed in advance before the code is compiled. The pre-processing code starts with a pound sign.1. About
#define
#defineDeclarations are mainly used to assign
#define宏定义在C系开发中可以说占有举足轻重的作用. The underlying framework does not have to say, in order to compile optimization and convenience, as well as cross-platform capabilities, macros are heavily used, it can be said that the bottom of development left define will be unable to move. When developing at a higher level, we put more emphasis on business logic and seem to have little use and reliance on macros.But the ben
1. Brief example of enum enum useWhen writing a program, we often need to associate an optional set of alternative properties for an object. For example, the students ' grades a,b,c,d and so on, the weather is sunny, cloudy, rainy and so on.More commonly, opening a file may have three statuses: input, output, and append. A typical practice is to define 3 constants, namely:const int input = 1;const int output = 2;const int append = 3;Then, call the fol
Constants must be defined before they are used, or the program execution will fail. Use the Define () function in the PHP tutorial to define constants.
1. Syntax format: define ("Constant name", "Constant value");
For example: Define ("php360", "Perfect php");
Here's an example:
The
1 , Syntax Statement: Parameter xx = YY;'Define XX YY Usage: Xx'Xx2 , Scope Parameter The file to be declared; 'Define It is valid from the time the compiler reads this instruction to the end of compilation, or 'Undef Command to make it invalid. If you want Parameter Or 'Define For the entire project, you can write the following statement into a
What is the difference between a variable and one?
define('SOMETHING', true);andconst SOMETHING = true;
Performance or otherwise?
Reply content:
What is the difference between a variable and one?
define('SOMETHING', true);andconst SOMETHING = true;
Performance or otherwise?
Baidu can solve the problem, the landlord did not self-study spirit?
【问】在php中定义常量时,const与d
1 define the constant define ( quot; constant quot;, quot; helloworld quot;); a constant can only contain scalar data (boolean, integer, float, and string) when calling a constant, just use a simple name
1. define the constant define ("constant", "hello world .");
Constants can only contain scalar data (boolean, int
The function and usage of macro definition (# define) belong to the basic category of C language. I will not describe it in detail here, but here I will only give the possible or potential risks caused by # define, hope to help you.
First look at this macro definition
1 # define max (A, B) (A> B? A: B)
Is there any problem with this macro as an addition ope
Compilation can directly read and write memoryProgramVariables are also required. However, unlike other advanced languages, it divides variables into many types, which are differentiated by the length of variables. Therefore, when defining (define) variables, five different keywords are used: DB, DW, DD, DQ, DT (in fact, only DB, DW are commonly used)DB (define byte) means that the defined variable occupies
Blog (http://blog.csdn.net/livelylittlefish) Post the notes prepared by the author (@ Xiaoyu) on the relevant research and study content. You are welcome to correct them!
1. macro definition
# Define aspect_ratio 1.653
The macro definition aspect_ratio may never be seen by the compiler, and may be replaced by the pre-processor before the compiler starts to process the source code. We know that the macro definition will be replaced with a string in t
There are two ways to define constants in C #, one called Static constants (Compile-time constant) and the other is called Dynamic constants (Runtime constant). The former is defined by "const", which is defined by "ReadOnly".
For static constants (Compile-time constant), it is written in the following ways:
public const int max_value = 10;
Why do you call it a static constant because, as the above declaration can be interpreted as follows (note: T
See AS3 under Flex B2 already have a tool to support preprocessing ... the framework of eclipse is this good
In fact, Mike Chambers early last year, almost this time to come up .... The method is quite ingenious, said that BT is more suitable for-__-.... Almost is to use C + + compiler, the written as file filter again .... Find that the foreigner's brain does move fast, it is also related to their knowledge of the entire framework of familiarity ... Alas.... It's far away, #_#.
Flash also suppo
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.