The fflush() argument is a pointer. Don't use 0 instead of NULL.