--- In [email protected], "John Matthews" <[EMAIL PROTECTED]> wrote:
>
> --- In [email protected], "David Hamill" <david@> wrote:
> >
> > Vic wrote:
> > Therefore you can compute str at runtime, e.g.:
> > 
> >   char *str[100]; /* <-- typo */
> >   /* compute str here */
> >   printf(str, i);
> 
> Corrected, and using the example in the question:
> 
>     int i = 123;
>     char str[100]; /* corrected */
>     sprintf(str, "%%%d", 5); /* use %% to get % */
>     printf(str, i);
>     printf("\nformat used: \"%s\"\n", str);
>


Reply via email to