Everywhere I see \"it is practically identical\", or something similar...
From The GNU C Programming Tutorial :
There is another function in t
Seems like the differences are, in 99.9% of the cases, meaningless.
One point which may make a difference - The man page says getc() may be implemented as a macro which evaluates stream more than once.
It could lead to strange behavior in some (not very useful) cases, e.g.:
FILE *my_files[10] = {...}, *f=&my_files[0];
for (i=0; i<10; i++) {
int c = getc(f++); // Parameter to getc has side effects!
}
If getc evaluates f++ more than once, it will advance f more than once per iteration. In comparison, fgetc is safe in such situations.