Byte order with a large array of characters in C

前端 未结 6 1819
梦毁少年i
梦毁少年i 2021-01-05 01:24

I am doing some socket programming in C, and trying to wrestle with byte order problems. My request (send) is fine but when I receive data my bytes are all out of order. I s

6条回答
  •  我在风中等你
    2021-01-05 02:08

    the network byte order is big endian, so you need to convert it to little endian if you want it to make sense, but if it is only an array it shouldn't make a fuss, how does the sender sends it's data ?

提交回复
热议问题