C fread not getting entire file

本秂侑毒 提交于 2019-12-02 01:09:17

The strlen function is exclusively for use on C-style strings. There is no way to tell the length of arbitrary binary data by looking at its content. You have the length in lengthRead.

            fprintf(stderr, "Content read:\r\n%s\r\n", *contents);

Same problem here. The %s format specifier is for C-style strings, not arbitrary binary data. You'll need to write your own function to print the data in some appropriate format.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!