C++ 仅在行不为空时递增
我正在用C++ 仅在行不为空时递增,c++,loops,vector,C++,Loops,Vector,我正在用向量填充表,但是向量中有一些空单元格,如果单元格不是空的,我只想创建一个新行,但表不喜欢这样,因为它希望行号按递增一个 i、 e 1,2,3,4,5 如果它是空的,则会像这样出现错误 1,2,4,5 那么,当一个单元格是空的,并且只有一个单元格中有内容,所以它保持不变时,我怎样才能使它不增加 1,2,3,4,5 代码 int it=0; 而(它setValue(popLocatedErrorColumn[it]); } it++; } 使用第二个整数索引跟踪当前行号 int it
向量填充表
,但是向量
中有一些空单元格
,如果单元格
不是空的
,我只想创建一个新行
,但表不喜欢这样,因为它希望行号按递增
一个
i、 e
1,2,3,4,5
如果它是空的
,则会像这样出现错误
1,2,4,5
那么,当一个单元格是空的,并且只有一个单元格中有内容,所以它保持不变时,我怎样才能使它不增加
1,2,3,4,5
代码
int it=0;
而(它setValue(popLocatedErrorColumn[it]);
}
it++;
}
使用第二个整数索引跟踪当前行号
int it = 0, index = 0;
while(it < popLocatedErrorColumn.size())
{
if(popLocatedErrorColumn[it] != "")
{
DCS_GET_HTMLKIT_REPETITION(uldtable, uldRow,NULL,index);
index++;
if(uldRow.getItem("locatedError"))
uldRow.getItem("locatedError")->setValue(popLocatedErrorColumn[it]);
}
it++;
}
int it=0,index=0;
而(它setValue(popLocatedErrorColumn[it]);
}
it++;
}
int it = 0, index = 0;
while(it < popLocatedErrorColumn.size())
{
if(popLocatedErrorColumn[it] != "")
{
DCS_GET_HTMLKIT_REPETITION(uldtable, uldRow,NULL,index);
index++;
if(uldRow.getItem("locatedError"))
uldRow.getItem("locatedError")->setValue(popLocatedErrorColumn[it]);
}
it++;
}