SyntaxFix
Write A Post
Hire A Developer
Questions
The problem is with sprintf
sprintf(aa,"%lf",a);
%lf says to interpet "a" as a "long double" (16 bytes) but it is actually a "double" (8 bytes). Use this instead:
sprintf(aa, "%f", a);
More details here on cplusplus.com