This works:
for (unsigned int i = 0; i < 30; ++i)
{
EditBoxNames[i] = Group1->get("Ime" + tgui::to_string(i)); // call EditBox named Ime
GroupNames.push_back(EditBoxNames[i]->getText()); // Take values from
saveGroup1Names(GroupNames); // call function to save Names to file
EditBoxLastNames[i] = Group1->get("Prezime" + tgui::to_string(i));
GroupLastNames.push_back(EditBoxLastNames[i]->getText());
saveGroup1LastNames(GroupLastNames);
EditBoxBrojTelefona[i] = Group1->get("BrojTelefona" + tgui::to_string(i));
GroupBrojTelefona.push_back(EditBoxBrojTelefona[i]->getText());
saveGroup1BrojTelefona(GroupBrojTelefona);
EditBoxDatumRodjenja[i] = Group1->get("DatumRodjenja" + tgui::to_string(i));
GroupDatumRodjenja.push_back(EditBoxDatumRodjenja[i]->getText());
saveGroup1DatumRodjenja(GroupDatumRodjenja);
TextBoxGrupaNapomene[i] = Group1Napomene->get("Group1NapomeneUcenik" + tgui::to_string(i));
GroupNapomene.push_back(TextBoxGrupaNapomene[i]->getText());
saveGroup1Napomene(GroupNapomene);
}
After that i called:
// here was for loop from prevoius code
// here was cout about vector size and capacity [ see picture ]
EditBoxNames.clear();
EditBoxLastNames.clear();
EditBoxBrojTelefona.clear();
EditBoxDatumRodjenja.clear();
// here was cout about new size and capacity [see picture ]
// new for loop starts here
So i clear those vectors to use them again in new for loop [ if needed i will post new for loop ] . And just before new for loop program crashes with core dumped. dbg says:
-------------------------------------------------------------------
nr: Adress: Func: File:
#0 0xb7d587b8 ??() (/lib/i386-linux-gnu/libc.so.6:??)
#1 ?? ?? () (??:??)
--------------------------------------------------------------------
picture:
http://s16.postimg.org/ro920dvd1/Screenshot_from_2013_07_25_16_18_44.png .
Have i done vectorName.clear wrong? Or it is something else?
Using gcc 4.6.3
code blocks 12.11
elementary os Luna Beta 2
if need more details ask and i will post
thank you in advance
wmbuRn
EDIT: When i comment entire new for loop with /* */ program doesnt crash. And it does do whatever is suposed to do. New for loop uses same vectors just like for loop i posted