Mail Archives: djgpp/1994/07/13/08:14:36
Hi,
Try the code:
#include <stdio.h>
void main(void)
{
double x;
x=1000;
printf("x=%lg\n",x);
}
Compiling with gcc -Wall prog.c I get a warning about using "l" with "g" when
printing a double. Really, as Eric Backus points out, K&R does not say anything
about the "l" prefix when printing doubles. The "info" program says that it
is to be used with the meaning of "L" for long doubles (?). The on line help
of Borland C says clearly that "l" with "e","f", or "g" is to be used when
printing a double (and it does not complain).
Antonio Carlos M. de Queiroz
- Raw text -