[Home]
[Edit this page]
[Recent Changes]
[Special Pages]
[Help]
OtherOS » cppint
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
OtherOS » cppint
(C/C++) int
data type (and thus a keyword) that can hold a single whole number. If you assign it to a broken number, this value gets rounded down. Your compiler should give you a warning then, as in the example below.int main(int argc, char* argv[]) { const int myValue = 12; const int myBrokenValue = 12.9; assert(myValue==myBrokenValue); return 0; }
- include <assert.h>
Advice
Topic links
Reference
- 1) Bjarne Stroustrup. The C++ Programming Language (3rd edition).ISBN: 0-201-88954-4
[Edit this page] [Page history] [What links here] [Discuss this topic] [Printer Friendly]
