Sportica   Sportica

结构体里的结构体。赋值

#include <stdio.h>


typedef struct shutter //第一个结构体定义
{
int min;
int max;
}shutter_t;

typedef struct image_s //第二个结构体定义
{
int hue;
int sharpness;
shutter_t judge; //把第一个结构体里的元素放到第二个结构体里
}image_t;
int main()
{
image_t image;
image.hue=5;
image.sharpness=6;
image.judge.max=8;
printf("hue:%d\n",image.hue);
printf("sharppness:%d\n",image.sharpness);
printf("judge:%d\n",image.judge.max);
}

 

 

posted @ 2011-12-12 13:47  qingjoin  阅读(1133)  评论(0编辑  收藏  举报
  Sportica