I have to call a method with the following signature:
int sendTo(const void* buffer, int length, const SocketAddress& address, int flags=0);
My first question is:
What does
const void* bufferexactly mean? My intention is: it means that it is a constant (unmodifiable) pointer which can point to anything. ist this somehow right?Second question:
The purpose of this method is, obviously, to send data over a socket. The first parameter is the data, the second is the length of that data. If I want to pass the string "hello" as the first parameter, how would I do this?
My idea:
char hello_str[1024] = "hello"
socket.sendTo(hello_str, sizeof(hello_str),.....);
would this work? But this way I have a way too big char array.
How can I create the array with the right size?
