Programming: Variables Explained

An understanding of what variables are. Variables are containers like baskets that carry an amount and a type of thing in the basket. With variables, there is a type of information that you can carry in the variable and the amount of that type. the type would be things such as unsigned char (character - 0 to 255), char (-128 to 128), unsigned int (integer - 0 to 4,294,967,295), int (integer - -2,146,483,648 to 2,146,483,648), float and double. There are variations of the types and each type takes space in memory. Char takes 1 byte of space, int takes 4 bytes of memory, short int takes 2 bytes, float takes 4 bytes, double takes 8 bytes and long double takes 12 bytes of memory.



Back to blog

Leave a comment

Please note, comments need to be approved before they are published.