'setfill' : ambiguous symbol?请问怎么改????
#include<iostream>#include<iomanip>
using namespace std;
//-------------------
struct Date
{
int year;
int month;
int day;
}; //分号!!!
void print(Date);
bool isleapyear(Date d);
//------------------------
int main()
{
Date d;
d.year=2000;
d.month=12;
d.day=6;
if(isleapyear)
print(d);
}
void print(Date s)
{
cout.setfill('0');
cout<<setw(4)<<s.year<<'-'<<setw(2)<<s.month<<'-'<<setw(2)<<s.day<<endl;
cout.setfill(' ');
}
bool isleapyear(Date d)
{
return (d.year%4==0&&d.year%100!=0||d.year%400==0);
}
E:\程序\日期结构体应用程序.cpp(25) : error C2039: 'setfill' : is not a member of 'basic_ostream<char,struct std::char_traits<char> >'
E:\程序\日期结构体应用程序.cpp(27) : error C2872: 'setfill' : ambiguous symbol