I looked at many examples before I wrote this, and I know many languages and clearly understand the syntax and what is going on in the code I listed below, however, when I compile my program for example:
gcc -o /sbin/"name" readfile.c
I get the following error:
This makes no since to me since my code clearly includes #include <stdio.h> which defines the FILE as referenced here ---- stdio.h.
//PROGRAM (readfile.c)
#include <stdio.h>
int main(){
FILE *fp;
fp = fopen("dummy.txt","w");
fprint(fp, "testing...\n");
fclose(fp);
}
//FILE (dummy.txt) *is in the same directory
Hello World
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire