I was wondering if anyone could help me with a quick problem. I'm trying to run a program that takes a lot of time for computations. I've been wanting to use a clean way to show that the program is still running. e.g. a period "." for every few cycles, and/or that rotating slash "|" -> "/" -> "-" -> "\" that you see in old DOS programs. The thing is, the only way output seems to come out is when I use the new line "\n" escape sequence. And that gives me lines of output that I don't want. Nothing else seems to work in the program. Can someone help?
Thanks for the suggestion, but I think you guys missed my point. Nothing prints during the loop when I do that. It will only show when the program gets to the next "\n" in the program. I'll give and example.
When I do:
1 2 3 4 5 6
/*loop 5 times*/{
//...stuff that takes 5 seconds to process
printf(".");
//...
}
printf("Some other statement\n");
It only prints ".....Some other statement" all at once after 25 seconds. The periods don't come every 5 seconds.
The only thing I know of right now that flushes the buffer onto the screen is "\n". Which I don't want.