I'm trying to just print a set number of characters instead of the whole string. According to this printf reference, I would do something like printf("%0.5s", example_string); to truncate it to 5 chars.
I can't seem to get this to work though - it doesn't make any difference. Any ideas? Is this a known limitation of the compiler?
Many thanks in advance
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
Posted: Thu Feb 04, 2010 3:01 pm
Post a very short (but compilable) test program that shows what you
have done. See this thread for an example of a test program for
floating point printf problems:
http://www.ccsinfo.com/forum/viewtopic.php?t=39954
Ttelmah Guest
Posted: Thu Feb 04, 2010 3:43 pm
I'd say it was a limitation.
Quite a few of the 'extended' printf abilities don't work in CCS. Things like left justification for example.
I'd just use the strncpy fuction to transfer the number of characters wanted, before printing.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum