fork download
  1. FILE* createFile(char* filename)
  2. {
  3. FILE *fptr;
  4.  
  5.  
  6. int i;
  7. if((fptr = fopen(strcat("D:\\CCPP\\file_list\\table\\", filename), "wb")) == NULL)
  8. puts("Cant create file");
  9. else
  10. {
  11. printf("File '%s' was successfully created\n", filename);
  12. fclose(fptr);
  13. }
  14. return fptr;
  15. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c:1:1: error: unknown type name 'FILE'
 FILE* createFile(char* filename)
 ^
prog.c: In function 'createFile':
prog.c:3:2: error: unknown type name 'FILE'
  FILE *fptr;
  ^
prog.c:7:2: warning: implicit declaration of function 'fopen' [-Wimplicit-function-declaration]
  if((fptr = fopen(strcat("D:\\CCPP\\file_list\\table\\", filename), "wb")) == NULL)
  ^
prog.c:7:2: warning: implicit declaration of function 'strcat' [-Wimplicit-function-declaration]
prog.c:7:19: warning: incompatible implicit declaration of built-in function 'strcat'
  if((fptr = fopen(strcat("D:\\CCPP\\file_list\\table\\", filename), "wb")) == NULL)
                   ^
prog.c:7:11: warning: assignment makes pointer from integer without a cast
  if((fptr = fopen(strcat("D:\\CCPP\\file_list\\table\\", filename), "wb")) == NULL)
           ^
prog.c:7:79: error: 'NULL' undeclared (first use in this function)
  if((fptr = fopen(strcat("D:\\CCPP\\file_list\\table\\", filename), "wb")) == NULL)
                                                                               ^
prog.c:7:79: note: each undeclared identifier is reported only once for each function it appears in
prog.c:8:3: warning: implicit declaration of function 'puts' [-Wimplicit-function-declaration]
   puts("Cant create file");
   ^
prog.c:11:3: warning: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   printf("File '%s' was successfully created\n", filename);
   ^
prog.c:11:3: warning: incompatible implicit declaration of built-in function 'printf'
prog.c:12:3: warning: implicit declaration of function 'fclose' [-Wimplicit-function-declaration]
   fclose(fptr);
   ^
prog.c:6:6: warning: unused variable 'i' [-Wunused-variable]
  int i;
      ^
stdout
Standard output is empty