There is partial code in C
When I compiled there were messages :
After looking up the reference for strcmp() in library, I still dont understand why there are messages here.Can some body explain to me.
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 */
[B]184:if ( strcmp(tem->messageText,text) == 0)[/B]
return tem;
else {
while ( tem != NULL ) {
[B]188: if ( strcmp(tem->next->messageText,text) == 0 )[/B]
break;
else
tem = tem->next;
}
}
return tem;
}
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
Comment