Mail Archives: djgpp/1996/05/05/09:19:45
I've been writing a few Turbo C programs in the past and have attempted to
port them to djgpp and have had a few problems here and there. But there
is yet another problem which mystifies me greatly. I avoided use of the
conio.h functions in Turbo C because they weren't portable, and to update
things like status displays on a single line, I repeatedly printed the
backspace character (ASCII 8, or "\b") to standard output until I get back
to the start of the output line and then printed the update. This works
properly with Turbo C under DOS and GCC 2.7.2 under Solaris 5.3, but not
under djgpp. What djgpp does is wait until the _last_ such update before
printing anything! Why? An example of this usage follows:
printf("Line: ");
for (i=0; i<n; i++) {
sprintf(bufr, "%d", i);
len = strlen(bufr);
printf("%s", bufr);
/* further processing */
for (j=0; j<len; j++) /* erase */
printf("\b");
}
-------------------------------------------------------------------------
University of the Philippines Rafael R. Sevilla
PABX/OVCA: Diliman Networking Project rsevilla AT sauron DOT upd DOT edu DOT ph
-------------------------------------------------------------------------
- Raw text -