c++ - How to print double using wsprintf -
i unable print double
value using wsprintf()
. tried sprintf()
, worked fine.
syntax used wsprintf()
, sprintf()
follows:
wsprintf(str,text("square %lf "),isquare); // not show value sprintf(str," square %lf",isquare); // works okay
am making mistakes while using wsprintf()
?
wsprintf
doesn't support floating point. mistake using @ all.
if want sprintf
, wide characters/strings, want swprintf
instead.
actually, since you're using text
macro, want _stprintf
instead though: it'll shift narrow wide implementation in sync same preprocessor macros text
uses decide whether string narrow or wide.
for it's worth: wsprintf
entirely historic relic. w
apparently stands windows
. included part of windows way when (back @ least windows 2.1, windows 1). written without support floating point because @ time, windows didn't use floating point internally (at all).
Comments
Post a Comment