哪个大侠能说说这个using namespace std怎么就错呢
#include <iostream.h>class Date
{
int mo, da, yr;
public:
Date( int m, int d, int y )
{
mo = m; da = d; yr = y;
}
friend ostream& operator<< (ostream& os, Date& dt );
};
ostream& operator<< ( ostream& os, Date& dt )
{
os << dt.mo << '/' << dt.da << '/' << dt.yr;
return os;
}
int main()
{
Date d(1965,12,25);
cout<<d<<endl;
return 0;
}
*****************************************************************************************
#include <iostream>
using namespace std;
class Date
{
int mo, da, yr;
public:
Date( int m, int d, int y )
{
mo = m; da = d; yr = y;
}
friend ostream& operator<< (ostream& os, Date& dt );
};
ostream& operator<< ( ostream& os, Date& dt )
{
os << dt.mo << '/' << dt.da << '/' << dt.yr;
return os;
}
int main()
{
Date d(1965,12,25);
cout<<d<<endl;
return 0;
}
*******************************
新手囊中羞涩。。。。请大侠不要见怪啊*^_^*