Allocation size of operators

Started by
2 comments, last by BlueDev 20 years, 7 months ago
Hi, Does anyone know where I can get the max allocation size of an ''int'' for example like 8 million or 4 million. I know a ''unsigned long'' can get in the billions but does anyone know what the max size of an int is. Thanks. - BlueDev BlueDev Net
[/quote]
Advertisement
#include <limits>int maxint = std::numeric_limits<int>::max();


Edit - missing semicolon.

[ Start Here ! | How To Ask Smart Questions | Recommended C++ Books | C++ FAQ Lite | Function Ptrs | CppTips Archive ]
[ Header Files | File Format Docs | LNK2001 | C++ STL Doc | STLPort | Free C++ IDE | Boost C++ Lib | MSVC6 Lib Fixes ]

[edited by - Fruny on August 31, 2003 7:29:12 PM]
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
Thank you very much Fruny, thats excatly what I was looking for.

Edit: for those that cant get that to compile, here is the max int value:

int maxint = 2147483647;

- BlueDev

[edited by - BlueDev on August 31, 2003 9:37:20 PM]
[/quote]
quote:Original post by BlueDev
for those that cant get that to compile, here is the max int value:

int maxint = 2147483647;

Correction: That''s the max int value on your machine. It is not the same on all computers.

This topic is closed to new replies.

Advertisement