Jim Michaels <[email protected]> said:
> I could not find a good example on this because examples in books are scarce 
> as hen's teeth. search engines ignore the * character and maybe even 
> interpret it like a wildcard. :-/ so examples on the web are out.
> 
> #include <stdio.h>
> int main(void) {
>     double d=1234567890.123456789;
>     int width=7,precision=3;//tried 3 and 9
>     printf("width=%d, precision=%d, d=%*.*f\n", width, precision, d);  
> //generates forever loop of spaces, program hangs.

Elementary programming error: for each * in the format, you must supply
an argument. man 3 printf

Cheers,
--Sampo

>     return 0;
> }
> 
> I need to use this. but it seems broken. it just locks up generating spaces 
> no matter what I put in for numbers. I don't think that's right.
> 
> 
>  
> -------------
> Jim Michaels
> [email protected]
> [email protected]
> http://RenewalComputerServices.com
> http://JesusnJim.com (my personal site, has software)


------------------------------------------------------------------------------
Is your legacy SCM system holding you back? Join Perforce May 7 to find out:
&#149; 3 signs your SCM is hindering your productivity
&#149; Requirements for releasing software faster
&#149; Expert tips and advice for migrating your SCM now
http://p.sf.net/sfu/perforce
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to