There is partial code in C
Code:
typedef struct message {
int messageId;
char *messageText;
struct message *next;
}message;
.....
.....
.....
/* Get a node before a node */
message *nodeBefore ( message *text ) {
message *tem;
tem = head;
/* If there are only 2 nodes ( a and b ),then nodeBeforeByText of a is returning to a */
184:if ( strcmp(tem->messageText,text) == 0)
return tem;
else {
while ( tem != NULL ) {
188: if ( strcmp(tem->next->messageText,text) == 0 )
break;
else
tem = tem->next;
}
}
return tem;
}
When I compiled there were messages :
Code:
q2.c:184: warning: passing arg 2 of `strcmp' from incompatible pointer type
q2.c:188: warning: passing arg 2 of `strcmp' from incompatible pointer type
After looking up the reference for strcmp() in library, I still dont understand why there are messages here.Can some body explain to me.