当前位置:网站首页>Understanding of C pointer
Understanding of C pointer
2022-06-22 05:52:00 【Silly boy: CPU】
C Understanding of pointer
The pointer ( An object in a programming language ): The pointer is the memory address , Pointer variables are variables used to store memory addresses , In the same CPU Under Framework , Different types of pointer variables occupy the same length of storage unit , Depending on the type of data stored in the variable , The amount of storage space used is also different .
int a=3; // Common variable definitions
Defining variables a When , The computer will give a Open up a memory space , This memory space is a The address of . For example 0xA0. What's in memory is 3 This value .
int *p;// Define a pointer
p = &a;// Pointer assignment
When defining pointers , The computer will also give p Open up a memory space , For example, the memory address is 0XB0.p=&a It means that you will a To the pointer , Stored in the memory of the pointer . That is to say Put a memory address in the memory space , Not a number or a constant .
*p;// Indicates to fetch the pointer address (p Address in memory ) Value pointed to (a Value in memory ).*p=3
p;// ordinary p The pointer ,p Address stored in ( The content is 0XA0), Unlike other variables that hold values or constants
&p;// Express p The address of ( Computer assigned address ), The content is 0XB0
*p;// Indicates the contents of the address pointed to by the pointer , The content is 3


边栏推荐
- Clion installation Download
- Adaboost
- An unordered array of N integers. Find the first number after each element that is larger than it. The time complexity is O (n)
- 使用SystemVerilog门模型描述的组合逻辑
- 數據的存儲(進階)
- 错误:note: module requires Go 1.17
- Tensorflow 2.x(keras)源码详解之第十四章:keras中的回调及自定义回调
- 线性回归:最小二乘、泰尔森估计、RANSAC
- 微信小程序开发 第一周:页面设置、页面跳转、数据绑定
- QEMU ARM interrupt system architecture 2
猜你喜欢

微信小程序开发 第一周:页面设置、页面跳转、数据绑定

Learning method 4 for promotion of big factories: play learning method

Record some problems and solutions encountered in processing SIF data

Creating GLSL Shaders at Runtime in Unity3D

Frame profiling

想投放Facebook广告却不知从何入手?此文带你深入了解

n个整数的无序数组,找到每个元素后面比它大的第一个数,要求时间复杂度为O(N)

Compréhension du pointeur C

C语言指针(进阶)

电脑卡顿怎么办?
随机推荐
I don't suggest you work too hard
独立站优化清单丨如何有效提升站内转化率?
Optimization direction of code walk through (convenient interface requests, long dynamic class judgment conditions, removal of useless consoles, separation of public methods)
北峰助力南昌市应急管理局打造公专融合应急通信保障网
Independent station optimization list - how to effectively improve the conversion rate in the station?
微信小程序给子组件赋值方式
Unity app提高设备可用性
Bat 常用批处理脚本记录
性能优化最佳实践之缩减游戏大小
代码走查的优化方向(接口请求便捷、动态class判断条件过长、去除无用console、抽离公共方法)
Error: note: module requires go 1.17
Xshell download and installation (solve the problem of expired evaluation)
Vscode remote connection error: server status check failed - waiting and retrying
时序构成的测试平台
Which is the trend of cross-border policy frequent adjustment of "independent stations & platforms"?
Non transitive dice (spring daily question 51)
向量空間視角看高數(1)——系列簡介
总有人问我:独立站该怎么玩?3个案例,你看完就懂了
u盘作为启动盘重装win10系统(无需其他软件)
Learning method 4 for promotion of big factories: play learning method