-->
Page 1 of 1

How to make system_get_chip_id() a string??

PostPosted: Sat Oct 03, 2015 4:40 am
by ashubhatt
I need to convert system_get_chip_id() into string.

It returns uint32 datatype, how to convert this into a string or char*??

Re: How to make system_get_chip_id() a string??

PostPosted: Sat Oct 03, 2015 10:43 am
by dkinzer
ashubhatt wrote:It returns uint32 datatype, how to convert this into a string or char*??
It is just a numeric value. In what form would you like it - decimal? hexadecimal? octal? Generally, one uses sprintf() to convert a numeric value to an equivalent sequence of characters but that function is "heavy" in that it contains code for formatting lots of different values (e.g. double, integer, character) in many different ways. Also, sprintf() has no buffer overrun protection so one must be careful using it. An alternate form, snprintf(), does . There are more special purpose routines that have more limited functionality and are, therefore, more lean. One example is itoa()