We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
I am using SPRINTF() function and it increase the code by 2.3K. Is there any method to reduce the code size.
Thanks,
Mashood
"sprintf() is a very comprehensive and powerful function"
It is indeed!
Just look it up in any 'C' textbook, and you'll that it takes several pages just to describe all the formatting options! If you think you could implement all that functionality in significantly less than 2.3K, there's nothing to stop you having a try...!
Probably easier to just implement the bit you actually need, though... ;-)
You could start by looking for open-source implementations of atoi, etc
Or perhaps start with an implementation of sprintf() and strip it down to just what you need.
Source code for FreeBSD C library:
www.freebsd.org/.../
Many compilers come with several partial implementations of the printf()-style functions along with the full one. Many of those are even smart enough to snoop the format strings, detect which formatting options you actually use, and link the most minimal implementation which has all the features in use. Keil is not, alas, one of these (so far as I know!)
"Keil is not, alas, one of these (so far as I know!)"
Alas, I think you're right there. :-(