结论
当目标还有字节可读时,返回实际读到的字节数。尽量读参数指定的长度,不够的话就能读多少读多少。
无字节可以读时,返回0或者负数。
If an error occurs, or the end of the file is reached, the return value is a short item count (or zero).
测试代码
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char **argv)
{
FILE *fp;
int ret;
unsigned char *buf;
int i;
if (argc

最低0.47元/天 解锁文章
2万+

被折叠的 条评论
为什么被折叠?



