The following code plays well in Visual Studio 2003 but not in Visual Studio 6. Can you tell me
why? Is a bug of the compiler?
#include <iostream>
using namespace std;
class hello
{
friend ostream& operator << (ostream& s, hello& h);
};
ostream& operator <<(ostream& s, hello& h)
{
s<<"hello world";
return s;
}
void main()
{
cout<<hello();
}
why? Is a bug of the compiler?
#include <iostream>
using namespace std;
class hello
{
friend ostream& operator << (ostream& s, hello& h);
};
ostream& operator <<(ostream& s, hello& h)
{
s<<"hello world";
return s;
}
void main()
{
cout<<hello();
}
