I'm writing a winsock function that call's recv(). Since the recv() function directly changes the variable directly, and uses the return value for something else, I need the user of the function to be able to create a variable, pass it to my function, then use the variable after it has been changed. However, I'm not sure how I could do this. What I have so far is similar to this:
There's more code that makes the function more intricate, but that's the only part where I need to send a pointer to a buffer to the recv() function. Am I passing the variable to my function the right way? Basically, what I'm aiming for is so I can do something like this:Code:INT MyFunc(CHAR *&mybuff) { INT iRecv = recv(socket, mybuff, strlen(mybuff), 0); }
Thanks for any helpCode:char *buff=""; if (MyFunc(buff) == 0) { printf(buff); //display the changed data; }