找回密码
 注册
搜索
查看: 859|回复: 4

[讨论] 一C程序(指针) 请教

[复制链接]
发表于 2008-10-30 19:32:44 | 显示全部楼层 |阅读模式
main()

{

struct node

{

int a;

int b;

int c;

};

struct node s= { 3, 5,6 };

struct node *pt = &s;

printf("%d" , *(int*)pt);

}

求教最后输出??
发表于 2008-10-30 20:21:07 | 显示全部楼层
理论上分析,应截取node结构s的第一个int值,即pt->a
在VC++6.0环境下编译,也是输出3的
点评回复

使用道具 举报

 楼主| 发表于 2008-11-3 11:48:36 | 显示全部楼层
抱歉,今天才上来查看

谢谢了!
点评回复

使用道具 举报

发表于 2008-11-4 00:49:09 | 显示全部楼层
哈,偶每天例行打卡;52RD偏手机RD点,感觉这里头,基础知识扎实的哥们很多
点评回复

使用道具 举报

发表于 2009-1-9 01:50:19 | 显示全部楼层
都是手机RD...
点评回复

使用道具 举报

高级模式
B Color Image Link Quote Code Smilies

本版积分规则

Archiver|手机版|小黑屋|52RD我爱研发网 ( 沪ICP备2022007804号-2 )

GMT+8, 2024-10-8 04:30 , Processed in 0.043418 second(s), 16 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表