当前位置:网站首页>Pzk's first understanding of pointer in learning C language
Pzk's first understanding of pointer in learning C language
2022-07-27 06:10:00 【Future Linux Driver Engineer pzk】

notes : 1. The black box represents the computer memory space , Why is the address below the horizontal line bad 4, Because of the definition of int type , One int The type is 4 Bytes , So bad 4;
2. int *p1; // This is the format of defining pointer variables , This is the rule
p1 = &a; // Defined int Type a Then your pointer can only define int Type can be assigned ,
// If you define char a=‘k’; Then you want to define the pointer variable storage a The address of can only be ,
//char *p1; p1=&a; That's how it works
#include <stdio.h>
int main()
{
int a;
a = 1;
int b;
b = 2;
int c;
c = 3;
int *p1; // This is the format of defining pointer variables , This is the rule
p1 = &a; // Defined int Type a Then your pointer can only define int Type can be assigned ,
// If you define char a='k'; Then you want to define the pointer variable storage a The address of can only be ,
//char *p1; p1=&a; That's how it works
int *p2;
p2 = &b;
int *p3;
p3 = &3;
return 0;
}
边栏推荐
- arcgis for js api(1) 获取featureLayer的所有字段名
- 链表回文判断
- 这是我的博客
- Cmder的基础文件操作
- 遥感影像识别-制作数据集
- Gbase 8C - SQL reference 6 SQL syntax (14)
- Li Kou daily question sword finger offer II 091. paint the house
- [song] rebirth of me in py introductory training (12): Matplotlib interface and common graphics
- 编程学习记录——第5课【分支和循环语句】
- Unity 窗口界面的简单介绍
猜你喜欢

tqdm无法单行显示的问题

根据SQL必知必会学习SQL(MYSQL)

The principle of hash table and the solution of hash conflict

非重叠矩形中的随机点(力扣每日一题)

如何选择正确的服务器备份方法

C语言扫雷最新 递归展开 超详解(附源码)

Super remote connection management tool: Royal TSX

遥感影像识别-多类识别下的错分问题

Code implementation and introduction of all commonly used sorting

STM32 infrared remote control
随机推荐
性感素数(Acwing每日一题)
socket 长链接
Gbase 8C - SQL reference 6 SQL syntax (12)
判断是否为回文结构的三种方法
Solve binary tree (7)
遥感影像识别-成像合成
Unity 桌面7.6 版本解读
关于druid连接不上数据库的问题
使用Markdowm
geonode geoserver win10 安装教程(亲测)
Weidongshan digital photo frame project learning (I) display ASCII characters on LCD
常见的SQL优化方法
[song] rebirth of me in py introductory training (12): Matplotlib interface and common graphics
编程学习记录——第3课【初识C语言】
IOT operating system
【第一篇博客-展望】
Live Home 3D Pro interior home design tool
UnityShader-高斯模糊
Lightroom classic 2022 v11.4 Chinese version "latest resources"
PS 2022 updated in June, what new functions have been added