C++/STL/byte array to shared_ptr 상위 문서: C++ STL 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 Show Comments Please enable JavaScript to view the comments powered by Disqus.