Socket programming question
- by dfddf
I am given the following declaration:
char inbuff[500], *ptr;
int n, bufferlen;
Write a program segement to receive a message having 500 bits from the TCP socket sock and store this message in inbuff.
My answer is:
n = recv( sock, inbuff, strlen( inbuff ), 0 );
However, I am not sure why *ptr is given in the declaration.
So, I would like ask, what is the purpose of the pointer in this question??
Or my program segement is wrong?
Thank you for all of yours help first!