当前位置:网站首页>特殊指针的一些应用
特殊指针的一些应用
2022-07-17 05:08:00 【学会放下ta】
特殊指针
指针和多维数组
指针索引和数组下标索引作用相同
int a[2][3]={
{
1,2,3},
{
4,5,6}};
int (*p)[3] = a;
则a[1][2]==*(*(a+1)+2)==*(*(p+1)+2)==6
void指针
void指针可以指向任意数据类型,可以用来在任意类型指针之间转换,但是不能直接对void指针解引用。
int a = 110;
int *pa = &a;
char *b = 'bbb';
void p;//报错,不能用void 定义变量
void *p;
p = pa;
printf("%d\n",*p);//报错,不能对void指针进行解引用
printf("%d\n",(int *)p);//ok
p = b;
printf("%s\n",p);//ok
NULL指针
当你不清楚你的指针要指向那里时,请把它初始化为NULL
int *p = NULL;
边栏推荐
- Data visualization
- 2020-10-22
- 分布式存储-fastdfs
- 从20s优化到500ms,我用了这三招
- MySQL--存储和游标
- UML (use case diagram, class diagram, object diagram, package diagram)
- Swagger配置与使用
- Two or three things to know about operation and maintenance safety
- 柠檬班软件测试培训可靠吗 这个从培训班逆袭成功的案例告诉你
- MySQL installation and configuration tutorial (super detailed)
猜你喜欢

mysql - 索引

【全网首发】JVM性能问题的自动分析

Data Lakehouse的未来-开放

Solutions for vscode terminal failure

A comprehensive performance optimization, from 5 seconds to 1 second

Redis source code analysis 3 implementation of discontinuous traversal
![[AI] action recognition using simple neural network -- Based on coco key points](/img/67/cd6be6e070fb5d4d44ee043ebd7fac.png)
[AI] action recognition using simple neural network -- Based on coco key points

Nacos配置管理

云服务器部署WEB项目

redis 源码分析 动态字符串实现(sds)
随机推荐
Continue from the previous issue: the remaining two methods of the rotation chart
Questions d'entrevue courantes du système d'exploitation
MYSQL基本语法字典
Easypoi之excel简单导出
Solutions for vscode terminal failure
Rxjs source code analysis (I) observable
[first launch in the whole network] one month later, we switched from MySQL dual master to master-slave
2022年春招最新消息:IT互联网行业平均薪资18500元
【AI】利用简单神经网络做动作识别——基于coco关键点
Three methods for cesium to obtain the longitude and latitude at the mouse click
第一个智能合约程序Faucet.sol
A comprehensive performance optimization, from 5 seconds to 1 second
线上软件测试培训机构柠檬班与iTest.AI平台达成战略合作
Opendds QoS and custom QoS (timing, timingqospolicy)
路由器loopback口实验
BUUCTF 杂项——二维码
Parent components plus scoped sometimes affect child components
Cesium 获取鼠标点击处经纬度的三种方法
MySQL安装配置教程(超级详细)
RK356x U-Boot研究所(命令篇)3.4 mem内存相关命令的用法