You did not show the definition of
buffer
but I assuming it is an array of
char
or a
char *
. In either event, your
name
field of the struct is an
int
. You cannot use
strcmp()
to compare these two dissimilar types.
Either store the data from your file as chars or convert the incoming buffer contents to an int. Your choice.
int p = atoi(buffer);
if (p == inputQ[i].name)
...