Reading and writing binary file

前端 未结 7 690
挽巷
挽巷 2020-11-22 16:29

I\'m trying to write code to read a binary file into a buffer, then write the buffer to another file. I have the following code, but the buffer only stores a couple of ASCI

7条回答
  •  醉话见心
    2020-11-22 17:01

     sizeof(buffer) == sizeof(char*) 
    

    Use length instead.

    Also, better to use fopen with "wb"....

提交回复
热议问题