CSDN博客

img wangjinhui

Struct is the same as int and float

发表于2004/9/17 20:20:00  447人阅读

int:

int Number=0;
Number=InputNumber();

=============================

struct Date
{
  int Day;
  int Month;
  int Year;
};

struct Person
{
 struct Date DOB;
 char Name[16];
};

struct Date InputDOB()
{
  struct Date DOB;
  DOB.Day=1;
  DOB.Month=2;
  DOB.Year=3;

  return(DOB);
}

main()

{
  struct Person person;
  person.DOB=InputDOB();
}

 

0 0

相关博文

我的热门文章

img
取 消
img