MSVC has plenty of bugs but that's not one of em (atleast in the form you've posted).
You have at least 5 syntax errors along with the constructor problem that Stoned pointed out. You should post the actual code that won't compile next time.
MSVC 6.0 compiles this just fine:
Code:
#include <iostream>
#include <string>
using namespace std;
class tst
{
string m_name;
int m_areacode, m_phonenum;
public:
tst(const char *name, int areacode, int phonenum)
: m_name(name), m_areacode(areacode), m_phonenum(phonenum) {}
friend ostream& operator<<(ostream &stream, const tst &obj);
};//tst
ostream& operator<<(ostream &stream, const tst &obj)
{
stream << "NAME: " << obj.m_name.c_str() << endl
<< "NUMBER: " << '(' << obj.m_areacode << ')'
<< obj.m_phonenum << endl << endl;
return stream;
}//ostream << tst
int main()
{
tst a("Lan", 555, 6785309);
cout << a;
return 0;
}//main
gg