Socket programming question

Posted by dfddf on Stack Overflow See other posts from Stack Overflow or by dfddf
Published on 2010-05-03T03:59:39Z Indexed on 2010/05/03 4:08 UTC
Read the original article Hit count: 265

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!

© Stack Overflow or respective owner

Related posts about socket-programming

Related posts about assignment