Bob Simpson

I am having trouble with sprintf when using it with char...

Discussion created by Bob Simpson on Oct 27, 2008
Latest reply on Oct 29, 2008 by Daniel Lundin
I am having trouble with sprintf when using it with char arrays instead of char pointers even when I use typecasting.

Example:
    char tmpstr[16];

        sprintf((char *)tmpstr, " %X", 1024);

I get a string with %X in it instead of 400.
I'm not a 'C' guru by any stretch.

Any ideas?
Thanks.
Bob

Outcomes