#include"iostream.h"
#include"stdio.h"
#include"string.h"
struct Date
{
int day,month,year;
};
Date GetDate();
void PrintDate(Date dd);
void main()
{
Date dt = GetDate();
PrintDate(dt);
}
Date GetDate()
{
Date dd={16,5,1995};
return dd;
}
void PrintDate(Date dd)
{
cout<<"生日是:"<<dd.year<<"年"<<dd.month<<"月"<<dd.day<<"日";
}
【C++】将结构作为参数传递并返回
最新推荐文章于 2022-03-16 21:32:47 发布