linux源码阅读笔记 void 指针

void 指针的步长为1,而其他类型的指针的步长与其所定义的数据结构有关。

example:

1 #include<stdio.h>
2 main()
3 {
4 int a[10];
5 int *m=a;
6 void *n=(void *)a;
7 m++;
8 n++;
9 printf("%x %x %x",a,m,n);
}

输出结果为:

69255b90

69255b94

69255b91

原文地址:https://www.cnblogs.com/elnino/p/4335218.html