首页  

各种指针的大小     所属分类 c 浏览量 585
Any type of pointer variable takes the same memory bytes in the memory, 
because they are used to store the memory addresses on other type of variables

the size of different types of pointers

内存地址
32位系统 内存地址占4个字节
64位系统 内存地址占8个字节

32位系统寻址范围是2的32次方


#include "stdio.h" int main(){ printf("sizeof(char*) = %d\n",sizeof(char*)); printf("sizeof(int*) = %d\n",sizeof(int*)); printf("sizeof(long*) = %d\n",sizeof(long*)); printf("sizeof(double*) = %d\n",sizeof(double*)); return 0; } sizeof(char*) = 8 sizeof(int*) = 8 sizeof(long*) = 8 sizeof(double*) = 8

上一篇     下一篇
二维整型数组参数传递的三种方式

C语言指针运算和指针类型

C语言指针和二维数组

C语言数据结构笔记

docker VS podman

C++模板