PHP의 SplFileObject 클래스의 C ++ / VC ++ 대안
-
11-12-2019 - |
문제
PHP의 PHP의 SplFileObject
와 동일한 클래스 또는 VC ++ 플러그인이 있습니까?
https://stackoverflow.com/questions를 참조하십시오./ 10650864 / Fetching-nth-line-of-a-file / 10650864 # 10650864 .C ++ 를 사용 하여이 작업을 수행하고 싶습니다.
해결책
왜 사용하려는 이유를 알지 못합니다. iostreams 또는 boost :: 파일 시스템은 무엇입니까?
http://msdn.microsoft.com/데 -D / Library / 22Z6066F % 28v= vs.100 % 29
http : //www.boost.org / doc / libs / 1_49_0 / libs / filesystem / v3 / doc / index.htm
업데이트 (주석을 읽은 후 코드 예제 추가) :
다음과 같은 것입니까?
#include <iostream>
#include <fstream>
#include <string>
int main(int argc, char* argv[])
{
auto fd = std::fstream("veryLargeFile.txt");
if (fd.good()) {
std::string buffer;
fd.seekg(200000);
std::getline(fd, buffer);
std::cout << buffer << std::endl;
}
fd.close();
return 0;
}
. 제휴하지 않습니다 StackOverflow