Can someone please tell me the the maximum and minimum of int, long int, long long int, double, float, and anything bigger than that? And also how to calculate this?

Recommended Answers

look in your compiler's limits.h header file. You will find them all there.

and anything bigger than that?

That doesn't make any sense. What do you mean by "bigger than that"?

And also how to calculate this?

How to calculate what? sizeof(object) returns the number of …

Jump to Post

All 2 Replies

look in your compiler's limits.h header file. You will find them all there.

and anything bigger than that?

That doesn't make any sense. What do you mean by "bigger than that"?

And also how to calculate this?

How to calculate what? sizeof(object) returns the number of bytes required to store the object, for example sizeof(char) is always 1, sizeof(int) can be 2, 4, or 8 (maybe larger), depending on the compiler and platform. sizeof does NOT return the largest number that can be stored in the int, just the number of bytes an int (or other object) occupies in memory.

There is also (on some systems) a long double which should be 128 bits (16 bytes) in size. In a C or C++ program, you can tell how big each type is by using the sizeof(type) function/macro. It will return the number of bytes the type occupies.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.