/*
* =====================================================================================
*
* Filename: f.c
*
* Description:
*
* Version: 1.0
* Created: 2014年02月27日 11时22分58秒
* Revision: none
* Compiler: gcc
*
* Author: YOUR NAME (),
* Organization:
*
* =====================================================================================
*/
#include <stdio.h>
typedef struct a {
int a;
int c;
}a;
typedef struct b {
struct a parent;
int b;
}b;
int main(int argc, const char *argv[])
{
static b x =
{
1,
2,
3,
/*
*.parent.a = 1,
*.parent.c = 2,
*.b = 3,
*/
};
printf("a = %d, c = %d, b =%d\n", x.parent.a, x.parent.c ,x.b);
return 0;
}
struct 赋值 初始化
最新推荐文章于 2023-02-16 22:43:50 发布