Hi guys i've created two classes one called
circle
and another use this
Code:
class soso { public: soso(); QList<circle*> lis; void go(); };
in the constructor of soso i've just added two circle
Code:
soso::soso() { circle* c1 = new circle(); circle* c2= new circle(); c1->id=1; c1->name="gimy"; c2->id=2; c2->name="susana"; lis.append(c1); lis.append(c2); }
and in the main window i've called go method which is included here
Code:
void soso::go() { throw " cannot open file ! "; int i=0; QList<circle*>::iterator it1 =lis.begin(); for(i=0;it1!=lis.end();it1++); { out<<(*it1)->id; // segmentation error in the runtime out<<(*it1)->name; } }
but i am getting segmentation error any body know why ?