C++ read(),write() ,seekg(),tellg()

Linux大全评论648 views阅读模式

istream &seekg(streamoff offset,seek_dir origin);

pos_type  tellg() 返回流置针所在的位置,返回值为整数

从文件origin位置开始移动offset个字节

读写数据块

要读写二进制数据块,使用成员函数read()和write()成员函数,它们原型如下:

read(unsigned char *buf,int num);

企鹅博客
  • 本文由 发表于 2020年9月4日 10:00:53
  • 转载请务必保留本文链接:https://www.qieseo.com/176681.html

发表评论