Here is the code that might help you understand my problem, i am using a node class and a list class. Here is the error:[Error] lvalue required as left operand of assignment. any help would be appreciated..!!
class Node{
private:
int data;
Node* next;
public:
void SetNext(Node* next){
this->next=next;
}
void SetData(int data){
this->data=data;
}
Node* GetNext(){
return next;
}
int GetData(){
return data;
}
};
class List{
private:
Node *CurrentLocation;
public:
List(){
CurrentLocation=NULL;
}
void SortList(){
Node *t1,*t2;
int temp;
for(t1=CurrentLocation;t1!=NULL;t1=t1->GetNext()){
for(t2=CurrentLocation;t2!=NULL;t2=t2->GetNext()){
if(t2->GetData()>t1->GetNext()->GetData()){
temp=t2->GetData();
t2->GetData()=t2->GetNext()->GetData();
t2->GetNext()->GetData()=temp;
}
}
}
}
};