This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

problem in the link list

xdata struct WindowList{
	 struct Windows * thisW;
	 struct WindowList * NextWindow;

};
xdata struct WindowList temp;
temp=temp.Next;//this line is generating an error.'=' incompatible operand
What is the reason of this error and how can i traverse this linklist.

Parents
  • First of all, Next is not a member of type WindowList, I guess that you meant NextWindow because otherwise you will get a quite different error.

    NextWindow is a pointer to a structure, but temp is an instance of a structure. These are indeed incompatible. Perhaps you intended that temp should be a pointer to a structure of type WindowList - that will fix you main problem.

    If it is the case that all WindowList structures are in xdata, all your pointers can be memory type specific.

    Thus:

        xdata struct WindowList
    	{
            struct Windows    xdata  * thisW;
            struct WindowList xdata  * NextWindow;
        };
    
        xdata struct WindowList *temp;
    
        temp=temp->NextWindow;
    

Reply
  • First of all, Next is not a member of type WindowList, I guess that you meant NextWindow because otherwise you will get a quite different error.

    NextWindow is a pointer to a structure, but temp is an instance of a structure. These are indeed incompatible. Perhaps you intended that temp should be a pointer to a structure of type WindowList - that will fix you main problem.

    If it is the case that all WindowList structures are in xdata, all your pointers can be memory type specific.

    Thus:

        xdata struct WindowList
    	{
            struct Windows    xdata  * thisW;
            struct WindowList xdata  * NextWindow;
        };
    
        xdata struct WindowList *temp;
    
        temp=temp->NextWindow;
    

Children
No data