cout.fill()编译出问题 求解
#include "iostream"#include "iomanip"
using namespace std;
class clock
{
public:
void settime(int newh=0,int newm=0,int news=0);
void showtime();
private:
int hour,minute,second;
};
void clock::settime(int newh,int newm,int news)
{
hour=newh;
minute=newm;
second=news;
}
inline void clock::showtime()
{
cout<<hour<<":"<<minute<<":"<<second<<endl;
}
int main()
{
clock bj;
bj.settime();
bj.showtime();
cout.fill('a');
cout<<setw(8)<<endl;
bj.settime(05,20,00);
bj.showtime();
return 0;
}
第一次出来结果是对的,第二次vc++就报错,这是为什么