c++,while(getline(infile,line)) { while(getline(infile,line)) { istringstream is(line); is>>equipment[P].amount>>equipment[P].price>>equipment[P].num>>equipment[P].lyr>>equipment[P].sbmc>>equipment[P].ssbm>>equipment[P].gmsj>>equipment[P].syzk; P++;Q

来源:学生作业帮助网 编辑:作业帮 时间:2024/11/30 03:36:09
c++,while(getline(infile,line)) { while(getline(infile,line)) { istringstream is(line); is>>equipment[P].amount>>equipment[P].price>>equipment[P].num>>equipment[P].lyr>>equipment[P].sbmc>>equipment[P].ssbm>>equipment[P].gmsj>>equipment[P].syzk; P++;Q
xSN0}^BHf3bUV6bp W&F M$ә2ǰQ"xi4;Ncy1Vx*r\<[a]W :)"˄]KeV s]lJ8Y3'SlʪV%ֲvE2XJS.%Ih^ǘ4+`J&-aڿNt|"^x['xh3&< NAs mh&z}m3!p_5FC5Z;'W4&ރa>Vkn+DSx_@ F]5s@-X֧q4

c++,while(getline(infile,line)) { while(getline(infile,line)) { istringstream is(line); is>>equipment[P].amount>>equipment[P].price>>equipment[P].num>>equipment[P].lyr>>equipment[P].sbmc>>equipment[P].ssbm>>equipment[P].gmsj>>equipment[P].syzk; P++;Q
c++,
while(getline(infile,line))
{
while(getline(infile,line))
{
istringstream is(line);
is>>equipment[P].amount>>equipment[P].price>>
equipment[P].num>>equipment[P].lyr>>
equipment[P].sbmc>>equipment[P].ssbm>>equipment[P].gmsj>>equipment[P].syzk;
P++;
Q++;
}
}
不太懂

c++,while(getline(infile,line)) { while(getline(infile,line)) { istringstream is(line); is>>equipment[P].amount>>equipment[P].price>>equipment[P].num>>equipment[P].lyr>>equipment[P].sbmc>>equipment[P].ssbm>>equipment[P].gmsj>>equipment[P].syzk; P++;Q
就是从一个文件中读一行数据,然后吧这行数据给一个istringstream
,用istringstream 将内容中的字符串string 一个个的赋给equipment[p] 中的相应值,
然后读取下一行赋给equipment[p + 1]