char *tmp=(char*)(txt.readLine().toStdString().c_str());
tab[i]=tmp;
char *tmp=(char*)(txt.readLine().toStdString().c_str());
tab[i]=tmp;
To copy to clipboard, switch view to plain text mode
I'm not a C++ expert but I think you should not do things like this. c_str() will give you a pointer internal object's storage containing null terminated string.
I'm not sure if the pointer you keep in tab[0] will be still valid when you are on next iteration after another
txt.readLine().toStdString().c_str()
txt.readLine().toStdString().c_str()
To copy to clipboard, switch view to plain text mode
.
Try what I wrote in a previous post - it's definitely more Qt-ish
Bookmarks