#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; }
标签:std,文件,ss,C++,char,内存,sizeof,data,szBuf From: https://www.cnblogs.com/FastEarth/p/17866807.html