问题
I have this code:
void caller()
{
char buffer[20][20];
int sd;
...
send(sd, buffer[7], 5, 0);
}
Now I have this code:
void funct(int sd, char **buffer)
{
send(sd, buffer[7], 5, 0);
}
void caller()
{
char buffer[20][20];
int sd;
...
funct(sd, buffer);
}
To simplify suppose that instead of ... I have an initialization of socket UDP and connection with the server to use send instead of sendto. I don't understand why the second code generates on send an error and errno is set with value 14, but the first work perfectly.
来源:https://stackoverflow.com/questions/64035362/unix-c-send-errno-14