Well to use a library takes two steps.
The first tells the compiler about (say wrefresh(), it's name, parameters etc), and you do this with #include
The second tells the linker WHAT actually implements the functionality you requested. If your library is called libcurses.a, then you typically have -lcurses as a command line option when you compile.
Salem
Posting Sage
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953
you could just use '\r' to make the cursor return back to the beginning of the line
int cookTime(int time) {
int second, minute;
for (minute = time; minute > -1; minute--) {
for (second = 59; second > -1; second--) {
sleep(1);
printf ("\r%2i : %2i", minute, second);
}
}
}
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
I have tried that but this does not produce an output on the screen. I always seem to have to use the newline character (\n) in order to get anything.
Try \r in your printf, and follow that with fflush(stdout); . (If you continue with this approach.)
Dave Sinkula
long time no c
5,058 posts since Apr 2004
Reputation Points: 2,780
Solved Threads: 314
I have tried that but this does not produce an output on the screen. I always seem to have to use the newline character (\n) in order to get anything.
Have you tried fflush(stdout); ?
mitrmkar
Posting Virtuoso
1,809 posts since Nov 2007
Reputation Points: 1,105
Solved Threads: 395
> Is there a different command other then printf that would produce the desired display?
Well you could post some code which actually shows your attempt at using curses.
Abandoning it, and stating "do you have any other idea" isn't the way forward.
Salem
Posting Sage
11,531 posts since Dec 2005
Reputation Points: 5,862
Solved Threads: 953