点击(此处)折叠或打开
- /*
- * =====================================================================================
- *
- * Filename: t.c
- * Version: 1.0
- * Created: 05/25/2012 09:35:49 AM
- * Revision: none
- * Compiler: gcc
- *
- * Author: xutao (xt), butbueatiful@gmial.com
- * HomePage: http://butbueatiful.blog.chinaunix.net
- * Company: akaedu.org
- * Copyright: Copyright (c) 2012, xutao
- *
- * Description:
- *
- * =====================================================================================
- */
- #include <stdio.h>
- struct student {
- int num;
- char *name;
- int score;
- } stu;
- int main(int argc, char *argv[])
- {
- struct student *p = &stu;
- stu.num = 1;
- (*p).name = "tom";
- p->score = 78;
- printf("num = %d\n", p->num);
- printf("name = %s\n", p->name);
- printf("score = %d\n", p->score);
- return 0;
- }