0

HI ALL,

i have written some code of line as

typedef struct _nodeList
{
   unsigned int pointCode; 
   struct NodeList *next;
}NodeList;
typedef unsigned int  PointCode ;
int right_configuration(NodeList *head,PointCode x, PointCode y)
{
   NodeList *node1;
   NodeList *node = head;
   int k =0;
   unsigned int NodePoint[100];
   node1 = (NodeList *)malloc(sizeof(NodeList));
   node1->pointCode= y;
            while(node->next)  /*store point codes before x */  
            {
               if(node->pointCode != x)
                  NodePoint[k]  = node->pointCode;  
               k++; 
               node = node->next; /* warning 1 */
            }
            node->next = node1; /* warning 2*/
}

in above code(function right_configuration is called from somewherelse) whn i compile my gcc compiler give this warning
warning1: assignment from incompatible pointer type
warning2: assignment from incompatible pointer type

why i am getting these warning here? i am not able to identify..
plz guide me

2
Contributors
2
Replies
3
Views
10 Years
Discussion Span
Last Post by johnray31
0

The only problems I found were:
1. The structure next was incorrect

typedef struct _nodeList
{
   unsigned int pointCode; 
   struct _nodeList *next;
}NodeList;

2. right_configuration() must return a value.

0

Thankx buddy..
yes that was a mistake i couldn't see.
thankx a lot again

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.