multidimensional arrays and transferring buffers

前端 未结 2 1464
情深已故
情深已故 2021-01-29 12:23

I am trying to save a buffer into array segments of 1800 characters. When ever I am able to transfer the buffer over but when I try to print each new buffer out. I get null for

2条回答
  •  青春惊慌失措
    2021-01-29 13:21

    Where are you incrementing the cbuf_pos, when assigning to the msg_buff? Also, in the if(buf_pos % 1800 ==0), terminate the msg_buff[key_num][cbuf_pos] with a '\0' (checking that there is one more character left).

提交回复
热议问题