[問題] fopen()/strcpy()疑問?
使用VC6, 用途比較folder A and B內的file是否一樣
但一直傳回"unhandled exception in main.exe 0x0000005: Access Vioation"
請各位大大幫忙解答
感謝!
char *source_path = "c:\\code\\Comp\\A\\*.*";
char *source = "c:\\code\\A\\";
char temp_B[255]={0};
char *destination = "c:\\code\\B\\";
WIN32_FIND_DATA FindFileData_A;
HANDLE hFindFile_A;
hFindFile_A = FindFirstFile(source_path, &FindFileData_A);
do{
FILE *fptr;
strcpy(temp_B,destination);
strcat(temp_B,FindFileData_A.cFileName);
fptr = fopen(temp_B,"r");
if(fptr != NULL) //found
else //no found
}while(FindNextFile(hFindFile_A, &FindFileData_A));
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 220.132.14.152
C_and_CPP 近期熱門文章
PTT數位生活區 即時熱門文章