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++;
    }