Mail Archives: djgpp/2000/10/20/18:42:55
On Fri, 20 Oct 2000, Ed Collins wrote:
> Hello, there
>
> When executing a C program in rhide under Windows98, I cannot get the printf
> function to work. Nothing is printed to the User Screen. Am I doing
> something wrong? Here is a sample of the code.
>
> tablestruc[0].symbol = "APPLE";
> tablestruc[0].symbval = 0X123;
> tablestruc[0].symbinfo = 17;
>
> printf("%s, %x, %d",
> tablestruc[0].symbol,tablestruc[0].symbval,tablestruc[0].symbinfo);
>
>
> I would certainly appreciate anyone's comments.
djgpp's printf uses a line-buffered mechanism for better performance.
I.e. nothing is actually printed until a newline ('\n') is encountered
in the output stream. Use "fprintf (stderr,.." or call "fflush(stdout)"
to force a immediate flush of the stream.
Gisle V.
- Raw text -