atoi will not work here.
atoi just converts the string to integer.
ie; 4 bytes string like "1234" = 1234
check the ASCII values for 1, 2 ,3 and 4
whcih are 49,50,51,52 corresponding hex values
are 31,32,22,34
Binary representation of this is
0011 0001 0011 0010 0011 0011 0011 0100 ==>Hex
Sanil P S <[EMAIL PROTECTED]> wrote:
> I am reading some data from a socket( TCP/IP)
> I need to interprent the data by parsing.
> The first 4 bytes of this data repreent
> and integer.Next field is a string ending by
> a null character and So on.
>
> I read the data from socket into a char*
I am reading some data from a socket( TCP/IP)
I need to interprent the data by parsing.
The first 4 bytes of this data repreent
and integer.Next field is a string ending by
a null character and So on.
I read the data from socket into a char* dynamically
allocated.
I am looking for functions /log