ftell fseek file size byte size 파일 크기 얻는 방법1 File Size ( file length ) 얻기 - ftell binary 로 파일을 읽어오는 프로그램을 작성하다 나중에 필요할까 싶어 정리해본다. ftell 과 fseek 만을 이용해서 file size를 얻어오는 방법을 이용하였다. int ftell ( FILE* stream ) - 스트림의 현재 file pointer 를 조사해서 시작점과의 거리를 바이트 단위로 리턴한다. #include int main(){ FILE* fpin = fopen( "input.txt" , "r"); fseek(fpin, 0L, SEEK_END); int fileLen = ftell( fpin ); fseek(fpin, 0L, SEEK_SET); std::cout 2010. 4. 23. 이전 1 다음