-
Dammned Variables
This is driving me nut's
why wont this work... and i know for a fact the pkt.u.buf variable contains the string i want
err = dpGetPlayerName(myDP, idFrom, nameBuf, sizeof(nameBuf));
pkt.u.buf[size-sizeof(dp_packetType_t)] = 0; /* Null terminate */
if (pkt.u.buf == "<userlist") {
printf("CALLED")
}
it just dosent activate the stament. and i dont know why
-
Your code is taken out of context and nearly impossible to read. But I guess pkt.u.buf is a char array.
You can't compare C-style strings this way. You have to use strcmp.