C++一段代码什么意思
if ((!ifs.bad())&&(!ofs.bad()))
{
while(getline(ifs,line, '\n'))
{
index = line.find_first_of('I');
value = line.substr(index+1);
istringstream stream(value);
while(stream>>ip)
{
ip=ip.substr(0,ip.find_first_of(','));
ofs << ip <<"\t\t";
if(stream>>ip)
{
ip=ip.substr(0,ip.find_first_of(','));
ofs<<ip<<endl;
}
else break;
}
ofs<<endl;
}
ifs.close();
}
请问以上代码中1、while(getline(ifs,line, '\n'))是为得到一行中的那些数据?
2、 value = line.substr(index+1);中line.substr()的用法
3、ip=ip.substr(0,ip.find_first_of(','));什么意思
以上为实现两个相邻的数据同时输出,是哪个语句实现的?