If my program asks a user to input a file name and then check if that file exists, would I have to use an if statement to see if that file is able to open?
Something like this:
When I tried this, it resulted in a warningCode:if(FILE_1 = fopen(nameoffile,"r") == NULL){ FILE_1= fopen(nameoffile, "w"); }
C4047: '=' : FILE * differs in levels of indirection from 'int'
My program still works. I've used a similar line of code in other programs without having this warning.



LinkBack URL
About LinkBacks


