hi there, I'm coding in windows, c++, but when I traslate my code to ubuntu, g++, I get this error: lvalue required as left operand of assigment
This is the line where I get the error:
&*raiz=&*p;
What could be the problem?
*raiz and *p are pointers to an avl structure:
typedef struct nodo{
int dato;
int fe;
int color;
struct nodo *izq;
struct nodo *der;
struct nodo *padre;
}nodo;
typedef struct nodo *avl;
and this is the method where I have the problem:
void RSD(avl *raiz){
avl *p; p=new avl; *p=NULL;
avl *q; q=new avl; *q=NULL;
avl *a; a=new avl; *a=NULL;
*a = (nodo*)*raiz;
*p = (*a)->izq;
*q = (*p)->der;
(*a)->izq=*q;
(*q)->padre=*a;
(*a)->padre=*p;
if ((*raiz)->padre->dato!=(*raiz)->dato)
(*p)->padre=(*raiz)->padre;
else
(*p)->padre=*p;
&*raiz=&*p; //ERROR!!
*p=(*raiz)->der;
*q=(*p)->izq;
}
Could someone tell me why I am having this error please? :'(
thanks