Simple question of integer input (C++)
I would think that the copyright dates on the Borland compiler are enough reason to reject it, right off. The language had only very recently been standardized in 2000. It's reasonable to suspect that standards compliance might not be all that great. :)
What happens if you run the program in Borland without showbase?
Perhaps it autodetects hex, and showbase is ignored.
Perhaps it autodetects hex, and showbase is ignored.
int x;cin >> x;
Erik Rufelt: just resurrected the old bc55 to confirm that showbase indeed has that "clever" feature.
Has anyone tested the Visual C++ compilers from before 2005? The prof said VS2003 had this behavior also.
Has anyone tested the Visual C++ compilers from before 2005? The prof said VS2003 had this behavior also.
It is I, the spectaculous Don Karnage! My bloodthirsty horde is on an intercept course with you. We will be shooting you and looting you in precisely... Ten minutes. Felicitations!
I'd counter your professor and say that using compilers which do not conform to the C++ International Standard isn't really programming in C++, but rather a crude adaptation of it. I'd point out that the C++ standard agrees with you and that he is using showbase improperly and that relying on the quirks of out of date or nonstandard conforming compilers is both bad programming practice on not real C++ programming. Just because one (or multiple) out of date or nonstandard conforming compiler deviates from the standard and provides some alternate functionality does not justify the usage of such blatantly inaccurate and incorrect code.
[size=2][ I was ninja'd 71 times before I stopped counting a long time ago ] [ f.k.a. MikeTacular ] [ My Blog ] [ SWFer: Gaplessly looped MP3s in your Flash games ]
Quote: Original post by Don Carnage
Erik Rufelt: just resurrected the old bc55 to confirm that showbase indeed has that "clever" feature.
Has anyone tested the Visual C++ compilers from before 2005? The prof said VS2003 had this behavior also.
For completeness sake, VS 2003 does behave good as well:
Decimal: 10
OUTPUT AS...
Hex: 0xa
Oct: 012
Octal: 010
OUTPUT AS...
Hex: 0xa
Dec: 10
Hex: 0x10
OUTPUT AS...
Dec: 0
Oct: 0
Fruny: Ftagn! Ia! Ia! std::time_put_byname! Mglui naflftagn std::codecvt eY'ha-nthlei!,char,mbstate_t>
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement