64,282
社区成员
发帖
与我相关
我的任务
分享
std::istream & operator>>(std::istream &is, string &s)
{
char* temp = new char[string::CINLEN];
is >> temp;
if (is)
s = temp;
delete[] temp;
return is;
}
friend istream & operator>>(istream &is,const OBJ &o)
{
char c = 0,buf[100];
int i = 0;
for(i = 0;i<100;i++)
{
is.read(&c,1);
if(c == '\r' || c == '\n')
{
break;
}
buf[i] = c;
}
return is;
}