double b = 3.0000;
char s[20];
sprintf(s,"%f",b);
Here char s[20] is fixed it should take values however small be it.I will be happy if I get tat 20 at runtime as a varible with correct allocation size.Else for small value ter will be wastage of memory.It will allocate 20 for small values also.I want this to be working in Linux so pure c or c++ is needed.Tat means I cant use vc++.Anybody pls help!!!