C++/STL/byte array to shared_ptr Edit Diff Refresh Backlink Random Search History Help Setting Hide Show byte array int length = 2000; byte* buf = new byte[length]; std::ifstream ifs(path, std::ios_base::in | std::ios::binary); if (ifs) { ifs.read((char*)buf, length); ifs.close(); } shared_ptr int length = 2000; std::shared_ptr buf(new byte[length]); //std::shared_ptr buf = std::shared_ptr(new byte[length]); std::ifstream ifs(path, std::ios_base::in | std::ios::binary); if (ifs) { ifs.read((char*)buf.get(), length); ifs.close(); } STL byte shared_ptr 이 글에는 0 개의 댓글이 있습니다. Please enable JavaScript to view the comments powered by Disqus. comments powered by Disqus