Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
Comments on Why does fopen return NULL?
Post
Why does fopen return NULL?
+3
−2
#include<stdio.h>
#include<stdlib.h>
int main (void){
FILE *cfPtr;
char name[15];
int ID;
if ((cfPtr = fopen("draft.txt","w")) == NULL){
printf("File could not be opened...\n"); //program gives me this as an output
}
}
Output:
File could not be opened...
1 comment thread