I want to use a function to log error messages. This function should open a log file and use fprintf to write to it. But I don't know how I should pass the arguments. For example:
log_error("Error at line %d at position %d\n",line,pos);
This means:
f = fopen(logfile,"a");
fprintf(f,"Error at line %d at position %d\n",line,pos);
fclose(f);