Definition of pointer:
I conclude that a pointer is a variable used to store the address of a variable of a certain type.
For example, unit8 * p = 0x5555 5555
Pointer p represents the variable used to store the address of the unit8 type variable
*Pointers are variables
*Pointers are variables that store addresses
*A pointer is a variable that stores the address of a variable of a certain type
Baidu defines it as:
Its value directly points to a value stored in another place in the computer's memory.
In the above example, *p means the number stored at the address 0x5555 5555.
Pointer definition format: (data type + asterisk) + variable name
For example, the following two examples
int * xxx
YYY*xxx
The meaning of pointer: At this time, the variable xxx becomes a pointer, which points to the first address of this data type.
Use of pointers:
typedef struct {
__IO uint32_t AAA;
__IO uint32_t BBB;
__IO uint32_t CCC;
__IO uint32_t DDD; } YYY; Let’s use a structure to illustrate
YYY->AAA means the content stored in variable AAA
Same thing with YYY.AAA, different ways of expressing it
Precautions:
In STM32, pointers are incremented by 4 bytes, for example, a pointer is 0x4001 2000
No matter what number is in it, the next pointer is 0x4001 2004
for example
uint8 i[5] = {0X11,OX22,OX33,OX44,OX55}
&i = 0X4001 2000
Then i[0] = *0X4001 2000
i[1] = *0X4001 2004
i[2] = *0X4001 2008
i[3] = *0X4001 200C
i[4] = *0X4001 2010
0x4001 2001~0x4001 2003 are empty.
Previous article:STM32 clock division factor
Next article:STM32 interrupt understanding
- Popular Resources
- Popular amplifiers
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Detailed explanation of intelligent car body perception system
- How to solve the problem that the servo drive is not enabled
- Why does the servo drive not power on?
- What point should I connect to when the servo is turned on?
- How to turn on the internal enable of Panasonic servo drive?
- What is the rigidity setting of Panasonic servo drive?
- How to change the inertia ratio of Panasonic servo drive
- What is the inertia ratio of the servo motor?
- Is it better for the motor to have a large or small moment of inertia?
- What is the difference between low inertia and high inertia of servo motors?
- 【Gravity:AS7341 Review】+ Choice of driver development board
- Get WiFi authentication method from 802.11 data frame
- CPU card programming system main frequency setting
- MSP430 CPU and MSP430X CPU
- EEWORLD University ---- Automotive eCall Power Solution
- ADI Vital Signs Monitoring Technology: Monitor the human body and win prizes by answering questions
- 【TI recommended course】#Lecture on basic knowledge of electronic circuits#
- Bluetooth intercom
- Because he mastered the company's "core technology", the boss hired several strong men to kidnap people on the street after leaving the company
- i.MX8MP Application Notes | Solutions to Common Problems