注册 登录
编程论坛 C++教室

大侠帮帮忙看看这个,错在那里,

wolfs 发布于 2008-03-15 20:42, 847 次点击
#include <iostream>
using namespace std;
struct date
{
 int yy,mm,dd;
};
struct date get_date();
int main ()
{
 struct date time;
 time=get_date();
 cout <<time<<endl;
}
struct date get_date()
{
 struct date tim;
 cout <<"Enter the time:";
 cin >>tim;
 return tim;
}
3 回复
#2
tszhao2008-03-15 21:03
你的运算符都没有重载!~~~
或者用你的结构体变量调用其中的成员变量
#3
sunkaidong2008-03-15 21:17
同意楼上观点..呵呵
#4
wolfs2008-03-15 21:35
是不是这样改?          :
cout <<time.yy<<time.mm<<time.dd<<endl;
          :
cin >>tim.yy>>tim.mm>>tim.dd;
1