Issue of pop back on vector of vector in c++
Hi I have below structure: structure str { string strNodeName; string strSheetName; Vector<vector<string> vecOneRowData; }; I have vector of above structure and what I am doing is adding object into vector if node Name is not present into vector... If object is already present, I am just adding vector of string into vecRowData. For specific case, I need to pop back data from vecRowData. This code works fine for smaller size of input. It fails and data randomly updates if pop back is performed more times.. I thought that after doing push_back post pop_back, issue occurs when push_back is asking for vector resize due to capacity reached. To avoid this, I thought to reserve 10000 elements for vector of vector.... It failed to compile and finally I did it but issue is not resolved. Commenting code line of pop_back works for any large input size. Unfortunately, I will not be able to share code for same as it contains confidential data. Feel free to ask in case of any query. Thanks in advance.