This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
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
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |