[菜农助学交流] 结构体

[复制链接]
1975|0
 楼主| tao560532 发表于 2011-9-18 02:10 | 显示全部楼层 |阅读模式
  1. /*/////////////////////////////////////////////////////////////////////////////
  2. 文件名:函数指针
  3. 时间:2011/9/18
  4. /////////////////////////////////////////////////////////////////////////////*/
  5. #include<stdio.h>

  6. /*/////////////////////////////////////////////////////////////////////////////
  7. 函数名:main
  8. 函数功能:主函数
  9. 入口参数:
  10. 出口参数:
  11. /////////////////////////////////////////////////////////////////////////////*/
  12. void main()
  13. {
  14. struct student
  15. {
  16. int number;
  17. int *name;
  18. char sex;
  19. int age;
  20. float score;
  21. };
  22. struct student stu;
  23. stu.number=1234;
  24. stu.name="wangtao";
  25. stu.sex='m';
  26. stu.age=20;
  27. stu.score=89.0;
  28. printf("%d\n",stu.age);
  29. printf("%s\n",stu.name);
  30. printf("%d\n",stu.number);
  31. printf("%c\n",stu.sex);
  32. printf("%f\n",stu.score);
  33. }


本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

×
您需要登录后才可以回帖 登录 | 注册

本版积分规则

个人签名:技术源于积累,成功源于执着!

31

主题

366

帖子

1

粉丝
快速回复 在线客服 返回列表 返回顶部