Welcome to HBH! If you have tried to register and didn't get a verification email, please using the following link to resend the verification email.

sendto(); ERROR


ghost's Avatar
0 0

OK, I need some help with my sendto(). This is written using winsock2.h so it may look a little different.

while (i < send) {
sendto(sock, *packet, length + 1, 0, (struct sockaddr_in*)&info, sizeof(struct sockaddr_in));
i++;
}

Whenever that part of the program is error checked, it returns "expected primary expression before ',' token." could someone explain that to me?


bl4ckc4t's Avatar
Banned
0 0

I think its trying to say either get rid of the 0 or create an expression with it. by expression I mean 1*1!=8 or 1-2=-1 That kinda.

Hope I am somewhat helpful

BC


ghost's Avatar
0 0

Ok, after random checking on the sendto(); statement, I found that the primary expression it wants, needs to be in the data part, or the *packet. I understand a primary expression is a name or a literal, but I can't seem to figure out what it specificaly wants. Any suggestions?