This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

printf asterisk flag dosn't work

Hi, I've problem with asterisk in printf, please help, I changed Hello world example as follows :

#include<stdio.h>

float f,g;

f = 10.0;
g = 22.95;

// printf ("Hello World\n"); /*
printf ("%*f != %*g\n", 8, f, 8, g);
and the result is:
//about 50 empty Spaces//
0.000000 =! //about 50 empty spaces// -1.59232e-23

this example is taken directly from C51 manual page 295! but it dosn't work, I also tried many other small variations but with no success it seems printf thinks that f and g are pointers! meanwhile printf without asterisk works fine.
please anybody can help!
thankyou in advance

0