首页 > 编程知识 正文

ifstream读取二进制文件,linux重命名文件

时间:2023-05-04 00:11:14 阅读:57475 作者:2145

//readafileintomemory # include iostream//STD :3360 cout # include fstream//STD 33603360 ifstream int main () STD 3333: if int length=is.tellg (; is.seekg(0,is.beg ); //allocate memory : char * buffer=new char [ length ]; //readdataasablock : is.read (缓冲器,长度); is.close (; //printcontent : STD :3360 cout.write (buffer,length ); delete[] buffer; }返回0; }

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。