Hello
I try a function "if not exist" but this will give my Warnings, please what would meant this warnings?
Code:
#include<stdio.h>
int main() {
FILE *fname;
if (fname = fopen("a.txt", "r")) {
fclose(fname);
printf("file exists");
} else {
printf("file doesn't exist");
}
}
to compile using "geany" and "GCC" for Windows.
Warning from Compiler
Code:
gcc -Wall -c "ifex.c" (im Verzeichnis: C:\Temp\tcc)
ifex.c: In function 'main':
ifex.c:4:8: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
5 | if (fname = fopen("a.txt", "r")) {
| ^~~~~
Kompilierung erfolgreich beendet.
please, if there problems with the GCC Compiler ? i see also
that in the meantime the Compiler Option i need to change from GCC 2 g++, and then the file will blow up over 2-3mb, for 10 lines Code?