#include <stdio.h>
#include <stdlib.h>
int main()
{
FILE *fp;
char written[]= "This is not as easy as I thought it would be.";
fp = fopen("Aufgabe 3.txt", "w");
if(fp != EOF)
{
fprintf(fp, "%s", written);
printf("Text was written!\n");
}
else
{
printf("File can not be found!");
}
fclose(fp);
return 0;
}
Hi, I am new to coding and need a little help. :D
Does anyone know how to get rid of the warning, I simply want to write a sentence into a .txt .
Warning in line: 10 if(fp != EOF)
:
comparison between pointer and integer