Chinaunix首页 | 论坛 | 博客
  • 博客访问: 5096177
  • 博文数量: 553
  • 博客积分: 13864
  • 博客等级: 上将
  • 技术积分: 11041
  • 用 户 组: 普通用户
  • 注册时间: 2011-11-28 21:25
个人简介

个人Blog: hhktony.com

文章分类

全部博文(553)

文章存档

2015年(1)

2014年(2)

2013年(12)

2012年(384)

2011年(154)

分类: LINUX

2012-02-22 06:41:00

点击(此处)折叠或打开

  1. /*
  2.  * =====================================================================================
  3.  *
  4.  * Filename: t.c
  5.  * Version: 1.0
  6.  * Created: 05/25/2012 09:35:49 AM
  7.  * Revision: none
  8.  * Compiler: gcc
  9.  *
  10.  * Author: xutao (xt), butbueatiful@gmial.com
  11.  *         HomePage:     http://butbueatiful.blog.chinaunix.net
  12.  * Company: akaedu.org
  13.  * Copyright: Copyright (c) 2012, xutao
  14.  *
  15.  * Description:
  16.  *
  17.  * =====================================================================================
  18.  */
  19. #include <stdio.h>

  20. struct student {
  21.     int num;
  22.     char *name;
  23.     int score;
  24. } stu;

  25. int main(int argc, char *argv[])
  26. {
  27.     struct student *p = &stu;    
  28.     stu.num = 1;
  29.     (*p).name = "tom";
  30.     p->score = 78;

  31.     printf("num = %d\n", p->num);
  32.     printf("name = %s\n", p->name);
  33.     printf("score = %d\n", p->score);

  34.     return 0;
  35. }

阅读(1932) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~