can anyone tell me what's wrong with my code..
here is the method..
it gives me error "incompatible types in return"Code:PositionNode addPosNode(int posNum) { PositionNode *newNode; newNode = malloc(sizeof(PositionNode)); if(newNode == NULL) { return NULL; } newNode->positionNum = posNum; newNode->nextPosition = NULL; return newNode; }
and here is the structure definition
Code:typedef struct positionNode { int positionNum; struct positionNode* nextPosition; } PositionNode;