by breadbox · 11y ago · 0 comments
#define with_open_file(fp, path, mode) \
for (FILE *fp = fopen(path, mode) ; fp ; fclose(fp), fp = 0) with_open_file(...) {
...
seek(fp,...)
read...
...
}
// nothing remains.I misinterpreted it as some kind of readall | map online, with actual code as 2nd clause of the for loop; reading fp as short for function_pointer at first.
NULL (and 0) evaluate to false in C.