이 코드가 있지만 5 행 (fseek)에 오류가 있습니다.C로 된 2 개의 파일을 크기로 비교하십시오.
int cmpFILEd(void *aa,void *bb){
int size1,size2;
FILE *a=(FILE*)aa;
FILE *b=(FILE*)bb;
fseek(a,0,SEEK_END);
fseek(b,0,SEEK_END);
size1=ftell(a);
size2=ftell(b);
if(size1==size2)
return 0;
else if(size1>size2)
return 1;
else
return -1;
}
이 코드의 문제점은 무엇입니까?
_
편집 : 오류 : 코드를 단순화했다 아마도 경우
First-chance exception at 0x77052865 (ntdll.dll) in cFILE.exe: 0xC0000008: An invalid handle was specified.
If there is a handler for this exception, the program may be safely continued.
무엇인가하는 것은 당신이 얻을 오류가, 있습니다 통과? – Mickey
'FILE *'보다는'FILE **' – BLUEPIXY
하지만 ** 대신 *로하면 ftell을 사용할 수 없다고 생각합니다. fseek – Mickey