...
Code Block | ||
---|---|---|
| ||
...
FILE *fp = fopen("foo.txt","r");
if( !fp ) { /* file does not exist */
FILE *new_fp = fopen("foo.txt","w");
...
fclose(new_fp);
} else {
/* file exists */
fclose(fp);
}
...
|
...
...
Code Block | ||
---|---|---|
| ||
...
FILE *fp = fopen("foo.txt","r");
if( !fp ) { /* file does not exist */
FILE *new_fp = fopen("foo.txt","w");
...
fclose(new_fp);
} else {
/* file exists */
fclose(fp);
}
...
|
...