标题:'setfill' : ambiguous symbol?请问怎么改????
取消只看楼主
韩雨航
Rank: 1
等 级:新手上路
帖 子:21
专家分:0
注 册:2012-1-12
结帖率:57.14%
已结贴  问题点数:20 回复次数:0 
'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
搜索更多相关主题的帖子: void include 
2012-02-11 22:28



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-360762-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.080570 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved