Forum Discussion
Altera_Forum
Honored Contributor
13 years agoUsing snprintf() is generally better than sprintf() since it guarantees that you won't write beyond the end of the buffer.
However, both of those functions will need the entire stdio library code (about 70k) in your image. If it isn't there already (eg you are using one of the 'small' BSP templates - or whatever they are called) and you are trying to fit the code into internal memiry, then you might have to do the numeric convertions yourself. That is hard, for decimal just repeatedly divide and remainder by 10 and add each remainder to '0', then output the characters in reverse order.