0
Hello, I’m having trouble trying to "print" on "big" integers in c++.
To be more specific, using the visual studio 2017
int main() {
_setmode(_fileno(stdout), _O_U16TEXT);
long rr = 6448915477954560;
wprintf(L"%ld\n", rr);
}
Problem: value shown on console, differs from typed, printing: 608174080
And why use the
wprintf()
? Why not use the good oldcout
?– Maniero
for aesthetic reasons on the console, I am using the "_setmode" to allow the use of type characters: "çñãê..." on the console, this forces me to use wprintf. However, when removing _setmode and using Cout again normally, the problem continues (this only happens in vs2017)
– umcaralegal9
It’s weird because VS2017 is just an IDE. And I use everything right with
cout
, so the problem is something else. https://answall.com/q/101691/101– Maniero