我在通过套接字发送int数组时遇到麻烦。 的代码看起来是这样通过套接字发送int,c,C++
程序1(运行在Windows)
int bmp_info_buff[3];
/* connecting and others */
/* Send informations about bitmap */
send(my_socket, (char*)bmp_info_buff, 3, 0);
计划2(上中微子运行)
/*buff to store bitmap information size, with, length */
int bmp_info_buff[3];
/* stuff */
/* Read informations about bitmap */
recv(my_connection, bmp_info_buff, 3, NULL);
printf("Size of bitmap: %d\nwidth: %d\nheight: %d\n", bmp_info_buff[0], bmp_info_buff[1], bmp_info_buff[2]);
应该打印 位图的大小:64
宽度:8
身高:8
位图大小:64
宽度:6
高度:4096
我该怎么做?
感谢它的工作。 – Lukasz