Dear all,
I am working on the code below:
int cookTime(int time) {
int second, minute;
for (minute = time; minute > -1; minute--) {
for (second = 59; second > -1; second--) {
sleep(1);
printf ("%i", minute);
printf (" : %i\n", second);
}
}
}
Now this works as I want it. So it produces an output which goes like this:
5 : 59
5 : 58
5 : 57 ....
etc. until it reaches 0.
Now I would like to modify the printf line so that the numbers are constantly refreshing on the same line. I have tried using refresh() function in curses.h but my gcc compiler says that the symbols are not found as below:
Undefined symbols:
"_wrefresh", referenced from:
_cookTime in ccyfOosO.o
"_stdscr", referenced from:
_cookTime in ccyfOosO.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
I am doing this on my mac with 10.6.2 OS and the latest xcode development environment (I think xcode 3).
Any suggestions would be great.
rjani1