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
It should be easier to turn on the LED lights or get input IO status, open the port clock, and then read and write the relevant GPIO registers, but it will take some trouble to implement an input interrupt.
For STM32 (CORTEX-M3) chip, to achieve a
On the two "modify startup code & rewrite vector table" SRAM initialization & Set Nvic Interrupt table offset article, we set the interrupt vector table, initialized the RAM, and reset the address of the vector table, this article is a relatively
Laya.loader is responsible for the load logic of resources and is managed by Loadermanager.
Laya supports the loading of multiple types of resources and also supports custom type loading. Different types of loading methods may be different.
1. Dispatch
There is a template function below, assuming an animal shelter organization provides it and they accept all the poor animals that are homeless, so they provide a function to the outside world to accept registration. The function looks
In the development of four-nation military games, use flex online game development-four-nation military games (5)-refine the chess development api, we have extracted the first api for chess game development-FlexChessAPI. This api design principle is
1. const Modifier
Initialization time:During compilation, the value has been embedded into the code during compilation;
Value status:Dynamic Modification not allowed
Modification Scope: Field, local variable
Main application scenarios: It is mainly
Static
I. backgroundCause: when the program executes the variable defined in the function to its definition, the compiler allocates space for it on the stack, the space allocated by the function on the stack is released at the end of the function
A static
1) Background
Cause: when the program executes the variable defined in the function to its definition, the compiler allocates space for it on the stack, the space allocated by the function on the stack is released at the end of the function
(1) staticThe static keyword is in the class, describing a member is static, and static can restrict external access, because the static member belongs to the class and does not belong to any object instance, other classes cannot be accessed. They
1) AutoThis keyword is used to declare that the lifetime of a variable is automatic. Variables not defined in any class, structure, enumeration, union, or function are considered global variables, the variables defined in the function are considered
Static is a common modifier in C ++. It is used to control the storage and visibility of variables. Next I will talk about the reason and role of static modifiers, the essence of the static modifier is comprehensively analyzed. Static: I. Control
Define section:Macros can be used not only to replace constant values, but also to replace expressions or even code segments. (Macros have powerful functions but are prone to errors, so their advantages and disadvantages are quite controversial
Static variables only exist in the function scope. That is to say, static variables only exist in the stack. Generally, variables in a function are released after the function ends, such as local variables, but static variables do not. That is to
1 static keyword
First, it indicates that the defined variables are static and the memory space is allocated in the static storage area. There are three main usage methods in C ++.
(1) use static keywords in Functions
Static int Var = 0;
Int
1. Static indicates the lifecycle of the modified object and the current application.
ProgramThe domain is the same, so it can be shared among multiple instances.
Const and readonly are two ways to declare constants in C #. Their differences are
Define section:Macros can be used not only to replace constant values, but also to replace expressions or even code segments. (Macros have powerful functions but are prone to errors, so their advantages and disadvantages are quite controversial
First, let's talk about final.1. final cannot be used to modify member attributes.2. final can only modify classes and methodsRole: The Modified class cannot inherit from the quilt class; the modified method cannot overwrite the method of the quilt
Define section:Macros can be used not only in place of constant values, but also in substitution of expressions or even code snippets. (Macros are powerful, but they are also prone to errors, so the pros and cons are quite controversial.) )
The
Const
Used to define constant values that cannot be changed at run time. Once defined and cannot change its value, an error occurs if the value is changed in the program.
The code is as follows
Copy Code
CALSS
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.