Hi! Is there a standard function for conversion of int to char? My goal is to convert an integer value (for example 45 to string "45") and then to use this value for file creation. Can you tell me an easy way to do this?
Thanks!
Ttelmah
Joined: 11 Mar 2010 Posts: 19552
Posted: Sat Feb 23, 2013 3:31 am
sprintf
Code:
unsigned int8 ival=45;
char str_buffer[5]; //remember the buffer must be large enough to
//include the terminating '\0' which makes the data into a 'string'
sprintf(str_buffer,"%u",ival);
Read the manual (or a generic 'C' book), for the formatting values.
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