Using large data structure for storage!
-
@Kushan I don't ask for the whole project. You should at least be able to say what the runtime error is and how big all those strings are. Did you try to debug your app to see where exactly it crashes?
Seriously, you really expect to get a solution without providing any information?wrote on 18 Oct 2017, 05:16 last edited by@jsulm
1)the error is "This application has requested runtime to terminate it in an unusual way!"
2)I will give part of a code-
QList<QStringList> sample;QStringList List;
List="Testing";
for(int i=0;i<number;i++){
sample<<List;
}Here number refers to the value entered through line edit(i.e 100 in my scenario)
-
@jsulm
1)the error is "This application has requested runtime to terminate it in an unusual way!"
2)I will give part of a code-
QList<QStringList> sample;QStringList List;
List="Testing";
for(int i=0;i<number;i++){
sample<<List;
}Here number refers to the value entered through line edit(i.e 100 in my scenario)
@Kushan This code isn't going to compile as "List="Testing";" is invalid.
Would be nice if you would post part of your real code or at least a sample code which you tested and verified that it is crashing.
Did you try to debug your app to see where exactly it is crashing? This is first thing to do in such a situation. -
@Kushan This code isn't going to compile as "List="Testing";" is invalid.
Would be nice if you would post part of your real code or at least a sample code which you tested and verified that it is crashing.
Did you try to debug your app to see where exactly it is crashing? This is first thing to do in such a situation.wrote on 18 Oct 2017, 05:26 last edited by KushanSorry I made a mistake(The above mentioned error still exists;) the code is
QList<QStringList> sample;
QString Test="Testing";
QStringList List;for(int i=0;i<number;i++){
List<<Test;
}for(int i=0;i<number;i++){
sample<<List;
} -
Sorry I made a mistake(The above mentioned error still exists;) the code is
QList<QStringList> sample;
QString Test="Testing";
QStringList List;for(int i=0;i<number;i++){
List<<Test;
}for(int i=0;i<number;i++){
sample<<List;
}@Kushan I tested this code: it does not crash (and I don't see why it should).
As I said you should first debug to see where it actually crashes.
And you still did not say how big your strings are. If they are huge then maybe your app gets out of memory and is terminated by the OS. -
@Kushan I tested this code: it does not crash (and I don't see why it should).
As I said you should first debug to see where it actually crashes.
And you still did not say how big your strings are. If they are huge then maybe your app gets out of memory and is terminated by the OS. -
@Kushan How long?
-
@Kushan That's not long.
Please debug you app to see where it is crashing. I'm out of ideas as the code you posted doesn't crash and there is not enough information to tell you why your app is crashing. -
@Kushan That's not long.
Please debug you app to see where it is crashing. I'm out of ideas as the code you posted doesn't crash and there is not enough information to tell you why your app is crashing. -
-
-
@Kushan No problem
-
@jsulm Actually the error is indexout of bound but I havent declared any size anywhere in my code for all the structures I have used!
@Kushan Are you accessing list elements using [] anywhere in your code like
QList<QString> list; qDebug() <<list[0];
?
-
@Kushan Are you accessing list elements using [] anywhere in your code like
QList<QString> list; qDebug() <<list[0];
?
-
@Kushan Are you accessing list elements using [] anywhere in your code like
QList<QString> list; qDebug() <<list[0];
?
16/22