以下是我帮网友写的
BCB, g++下通过, vc6不行, 正是好笑
他说我的
friend ostream& operator << (ostream& out, const student& st);
不可以访问protected的变量;
vc在c++的标准方面作的不好,没理由就他一个不行;
不过我也不能太武断, 也许有什么我不知道?class student

friend ostream& operator << (ostream& out, const student& st);
friend istream& operator >> (istream&  in, student& st);public: student(const unsigned id, const char* name,  const float score)
: _id(id), _name(name), _score(score)
{
}protected: string _name;
unsigned _id;
float _score;
};ostream& operator << (ostream& out, const student& st)
{
return out << st._id << "  " << st._name <<  "  " << st._score << endl;
}istream& operator >> (istream&  in, student& st)
{
return in >> st._id  >> st._name  >> st._score;
}