代码如下所示:

实现代码如下:

#include <stdio.h> 
int main(int argc, char *argv[]) 

    int a[2]; 
    unsigned int add1 = &a[0]; 
    unsigned int add2 = &a[1]; 
    printf("The address of a[0] is %u/n",add1); 
    printf("The address of a[1] is %u/n",add2); 
    printf("The size of int is %u/n", add2 - add1); 
}

输出结果是:
The address of a[0] is 3218821936
The address of a[1] is 3218821940
The size of int is 4

以上就是【解决不用sizeof求出int大小的方法】的全部内容了,欢迎留言评论进行交流!

赞(0) 踩(0)

与本文相关的软件

发表我的评论

最新评论

  1. 暂无评论