emailstorbala wrote:
double num = 23e45;buffer = new char[sizeof(double) + 1];
Here you allocate 9 bytes.
sprintf(buffer, "%lf", num);
And here you are writing the string "23000000000000000602806197963719130677638070272.000000", which is longer than 8 characters.
Tobias