I have a function call in my main function. It is suppose to be a progress reporter. Each time the function is called, as shown below, the progress is to be printed on the screen.
Code:
loop_counter(&loop_count, some_constant);
The function body looks like the following:
Code:
void loop_counter(long long *loop_count, long long some_constant)
{
*loop_count++;
if(*loop_count % 40000 == 0 || *loop_count == some_constant)
fprintf(stderr,"\r %d %% done ", (long long)(100.0*(double)(*loop_count)/(double)some_constant));
}
For some reason, nothing gets printed on the screen. Can anyone tell me why this is?