if( (fp=fopen(strPath.c_str() , "wb")) = NULL) //잘못된 구문
if( (fp=fopen(strPath.c_str() , "wb")) == NULL)//수정한 구문
//if문 안에서 fp에 NULL이 대입되어 버리네요
그럼..
거짓말처럼 님이 쓰신 글 :
: FILE *fp;
:
: String strPath = "G:\\FileRecv\\";
: strPath += "aaa.txt";
: if( (fp=fopen(strPath.c_str() , "wb")) = NULL)
: {
: ShowMessage("FileOpen Error");
: return;
: }
:
: for(int i = 0 ; i < 10 ; i++)
: {
: char szBuf[10];
: strcpy(szBuf , "111111111");
: fwrite(szBuf , sizeof(char) , 10 , fp);
: }
:
: fclose(fp);
:
: 이 렇게 했을시 EAccessVioation with message 'Access violation at address 326663a1 in module ~~~~' . Read of address
:
: F8344CFC' 에러가 뜨는데 그이유를 모르겠습니다....
|