C++/(MFC)CStdio File을 이용한 파일 처리 상위 문서: C++ CString filename; filename.Format(_T("test.txt")); CFileException ex; CStdioFile file; //setlocale(LC_ALL, "korean"); if (!file.Open(filename, CFile::modeRead | CFile::typeText, &ex)) { TCHAR szError[1024] = {0,}; ex.GetErrorMessage(szError, 1024); CString msg; msg.Format(_T("파일 열기에 실패했습니다.\r\n\r\n%s"), szError); //D0(msg.GetBuffer(0)); return FALSE; } CString line; while (file.ReadString(line)) { // work something } file.Close(); Show Comments Please enable JavaScript to view the comments powered by Disqus.