Variable types - what?

I do understand what we use variable types for.. But i dont understand why they all have different sizes? i get that its because we want to store information.. But i dont understand what the information needs of space.
I know most of you wont understand what i mean, i am sorry :(

example:


BYTE = 8bits
DWORD = 32bits [Info],[],[]

or

int = 2bytes (i think)
double = 8bytes

If i had a value of 1667.. how many bytes would i need for that?
The bytes are not so important.

The C/C++ standard defines only minimum size for each built-in type.
See the "data ranges" in http://www.tutorialspoint.com/cplusplus/cpp_data_types.htm

But in your platform they can be longer. To check that you need http://www.cplusplus.com/reference/limits/numeric_limits/
a 16-bit unsigned integer would be able to represent 65536 distinct values in the range 0 to 65535.


~Taken from the Variables and Types section on this websites tutorials.
Last edited on
Thanks :D
Topic archived. No new replies allowed.