C语言:结构体地址

复制代码
#include <stdio.h>
main()
{
    struct student{
        char no[7];
        char name[8];
        int score;
    };
   struct student st1,st2;
   //printf("%d\n",&student);
   printf("%d %d %d %d %d\n",&st1,&st1.no,&st1.no[2],&st1.name,&st1.score);
    printf("%d %d %d %d %d\n",&st2,&st2.no,&st2.no[2],&st2.name,&st2.score);
    printf("%x %x %x %x %x\n",&st1,&st1.no,&st1.no[2],&st1.name,&st1.score);
    printf("%x %x %x %x %x\n",&st2,&st2.no,&st2.no[2],&st2.name,&st2.score);
    getchar();
 }
复制代码

 

 

posted @   myrj  阅读(316)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· 别再用vector<bool>了!Google高级工程师:这可能是STL最大的设计失误
· 单元测试从入门到精通
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 上周热点回顾(3.3-3.9)
历史上的今天:
2021-09-17 C语言 拼音转汉字
2021-09-17 字符数组赋值值
2021-09-17 C语言:查找字符串出现的次数函数
2021-09-17 C语言 汉字转拼音
点击右上角即可分享
微信分享提示