加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

(C/C++) 32bit \ 64bit 記憶體空間

发布时间:2020-12-16 07:19:13 所属栏目:百科 来源:网络整理
导读:char str[] = " Hello " ; char *p = str ;printf( " sizeof(str) = %dn " , sizeof (str));printf( " sizeof(p) = %dn " , sizeof (p));printf( " sizeof(short) = %dn " , sizeof ( short ));printf( " sizeof(int) = %dn " , sizeof ( int ));printf(
char str[] = "Hello" ;
char *p = str ;
printf("sizeof(str) = %dn",sizeof(str));
printf("sizeof(p) = %dn",sizeof(p));
printf("sizeof(short) = %dn",sizeof(short));
printf("sizeof(int) = %dn",sizeof(int));
printf("sizeof(long) = %dn",sizeof(long));
printf("sizeof(long long) = %dnn",sizeof(long long));
printf("sizeof(size_t) = %dn",sizeof(size_t));
printf("sizeof(double) = %dn",sizeof(double));
printf("sizeof(long double) = %dn",sizeof(long double));

64 bit :

sizeof(str)       = 6
sizeof(p)         = 8
sizeof(short)     = 2
sizeof(int)       = 4
sizeof(long)      = 8
sizeof(long long) = 8
sizeof(size_t)    = 8
sizeof(double)    = 8
sizeof(long double) = 16

32 bit :

sizeof(str)       = 6
sizeof(p)         = 4
sizeof(short)     = 2
sizeof(int)       = 4
sizeof(long)      = 4      
sizeof(long long) = 8
sizeof(size_t)    = 4
sizeof(double)    = 8
sizeof(long double) = 12

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读