How do I convert double value to a char array in C?
double a=2.132; char arr[8];
Is there any way to do this in standard C? Can anyone give
Although I see some answers, I imagine you'd like to see code -- I'll just use snprintf although you might prefer a more secure form:
snprintf(arr, 8, "%2.4f", a);
more here: http://msdn.microsoft.com/en-us/library/2ts7cx93(VS.71).aspx