You are not logged in.

1

Saturday, July 24th 2010, 4:37pm

Excuse me a minute

Source code

1
2
3
4
5
6
7
8
9
10
11
void MainWindow::print()
{
input_events * ptr_ie;
ie * ine;

QString resultString = "";
for(ine=ptr_ie->l; ine; ine = ine->suiv)
{
ui->textBrowser->setText(ui->textBrowser->toPlainText() + resultString.setNum(ine->id) + " ");
}
}


The problem is that does not print output in function print() "Print all"


Thank you for your time

This post has been edited 1 times, last edit by "NewLegend" (Jul 25th 2010, 2:23pm)


yasin_motcu

Beginner

  • "yasin_motcu" is male

Posts: 32

Location: Türkiye

Occupation: Computer Engineer

  • Send private message

2

Saturday, July 24th 2010, 10:05pm

your code and variable usage is very difficult to understand, I think you have to write a clear code for people to pay attention your problem. Whatever, it seems that ptr_ie is a kind of container that holds structs in your code and you are creating new ptr_ie pointer to object each time your Get_ınfo function is called and also in print function your newly created ptr_ie is decalred without any initialization so of course you will reference unrelated part of your memory. Declare your input_events * ptr_ie as a private member in your Mainwindow class and define it in your constructor and remove ptr_ie declarations from your get_info and print function.
Don´t let your fears stand in the way of your dreams!