|
|
|
|
So how does one conclude that if temp->returnNext()==NULL there's only one element?“ |
- Second, I can't understand in the Print() : if(temp->returnNext()==NULL){cout << temp->returnData() << "-->" << "NULL" << endl;} |
|
|
|
|
else if(temp->returnNext()==NULL){cout << temp->returnData() << "-->" << "NULL" << endl;}
|
|
if(temp==NULL){ cout << "The list is Empty" << endl;}
is true, but when temp is a nullpointer there is no data to return and a segmentation fault will arise.else if(temp->returnNext()==NULL){cout << temp->returnData() << "-->" << "NULL" << endl;}
|
|