文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>fread,fwrite 与read,write

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


相关阅读 更多 +
排行榜 更多 +
胜利女神新的希望小米服手游下载

胜利女神新的希望小米服手游下载

角色扮演 下载
我要当老板伐木工厂游戏下载

我要当老板伐木工厂游戏下载

模拟经营 下载
涡轮螺旋桨最新版下载

涡轮螺旋桨最新版下载

模拟经营 下载