My problem is simple enough but I'm not able to fix this...
In my header:
QTextStream *in = NULL;
in one method the QTextStream gets initialized:
in = new QTextStream(&file);
then I am trying to parse it in another method:
QString next;
if(in != NULL){
while(!in->atEnd()){
next = in->readLine();
}
}
else{
QMessageBox::critical(this, "Error", "No file to test!");
}
While initializing works fine, the app crashes at the test if in is atEnd(). What am I doing wrong? I need in to be accessible from several methods. I have to use a pointer here (?) because in gets initialized later (AFAIK that's not possible with references)
It might be obvious but I'm fairly new to c++...
Thank you!