fread,fwrite 与read,write
时间:2010-10-19 来源:dlczh
manpage home 中写道:
Section 1user commands (introduction) 用户命令
Section 2system calls (introduction) 系统调用
Section 3library functions (introduction) 库函数
#include <stdio.h>fread(3) 为库函数
FILE *fp = fread(void *ptr, size_t size, size_t nmemb, FILE *stream);
fp指向的应该为FILE*文件类型的首地址
fwrite(3) 也为库函数
FILE *fp = fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream);
fp指向的应该为FILE*文件类型的首地址
#include <unistd.h>
read(2) 为系统调用
read(int fd, void *buf, size_t count)
write(2) 为系统调用
write(int fd, const void *buf, size_t count)
fd为文件描述符(file descriptor fd),一个正型变量
maybe because we were close to end-of-file, or because we are reading from a pipe, or from a terminal
Section 1user commands (introduction) 用户命令
Section 2system calls (introduction) 系统调用
Section 3library functions (introduction) 库函数
#include <stdio.h>fread(3) 为库函数
FILE *fp = fread(void *ptr, size_t size, size_t nmemb, FILE *stream);
fp指向的应该为FILE*文件类型的首地址
fwrite(3) 也为库函数
FILE *fp = fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream);
fp指向的应该为FILE*文件类型的首地址
#include <unistd.h>
read(2) 为系统调用
read(int fd, void *buf, size_t count)
write(2) 为系统调用
write(int fd, const void *buf, size_t count)
fd为文件描述符(file descriptor fd),一个正型变量
maybe because we were close to end-of-file, or because we are reading from a pipe, or from a terminal
相关阅读 更多 +