I want to keep a static location to write to, due to multiple instantiations. I want to be able to add to the list from each instantiation. But only the first one is kept.
Not sure what to do?
Works for pointer of type char. But when I tried converting QStringList to pointer I just kept getting an error: Segmentation Fault.
*.h
QStringList msgList;
*.cpp
fncInit(){
static QStringList MessageList;
msgList = MessageList;//keep the location constant for all new instantiations
}
fncBuild(QString strMessage){
MessageList.append(strMessage); //if I use a pointer QStringList through out, I get Segmentation Fault.
}
fncPrintf(){
for(int i; i < msgList.count(); i++){
printf("%d) %s", i, msgList.at(i).toStdString().c_str());
}
}