C++中如何使用内存文件

#include <iostream>
#include <strstream>
using namespace std;


int main()
{
    char                szBuf[16]   =   {"hello world!"};
    std::strstreambuf   memo(szBuf,sizeof(szBuf));
    std::istream    ss(&memo);
    ss.seekg(0);
    char    data[4] =   {0};
    ss.read(data,sizeof(data));
    return  0;
}

 

posted @ 2023-11-30 10:51  经纬视界  阅读(23)  评论(0编辑  收藏  举报