Originally posted by Stan James:
I don't know C so I'm guessing at how to diagnose this.
* Is the size the same? 4-bytes on both sides?
* Is the order the same? See this Endian Essay for what I mean.
In any case, I'd read one byte / char at a time and display them to see what's going on. Let us know what you find!
Hi stan,Thanks for the response.
am able to receive them in a byte array.
and yeah,sizeof int in both C and Java is 4.
I don't know if this is the right place to post my query,but this problem was encountered, during the socket commn. between C and Java
I created a structure,struct1 on C-end with contents as int,char[15],char[15],int.
Now,i Have another structure,struct2 with the reference of struct1 in it.
The actual size of struct1 is 38,but when i say sizeof(struct1) or sizeof(struct2),it gives me 40.
Extra zero values are padded after the 2nd char[] and thereby,I face problems in reading the 2nd int value.
Can anyone help me with this??