_finddata_t 관련
조회수 718회
지정한 폴더 내의 파일들을 모두 출력해주는 프로그램을 만들고 있습니다
char path[] = "C:\\hanu";//폴더지정
이렇게 폴더를 지정했고
void main()
{
_finddata_t fd;
long handle;
int result = 1;
handle = _findfirst(path, &fd);
if (handle == -1)
{
printf("There were no files.\n");
return;
}
while (result != -1)
{
printf("File: %s\n", fd.name);
result = _findnext(handle, &fd);
}
_findclose(handle);
return;
}
소스코드는 이렇습니다. 제가 지정한 hanu 폴더 안에는 텍스트파일 3개가 있는데 프로그램을 실행시켜보면 file:hanu 이렇게만 나오네요. 파일경로 지정이 문제인가요? 뭐가 문제인지 알려주시면 감사하겠습니다
-
(•́ ✖ •̀)
알 수 없는 사용자
댓글 입력