|
Didn't we have a conversation about this in another thread... Can't remember which, but the function sizeof() will be valuable to you, if it's structure-size you're concerned about.
Basicaly any type you create your variable as, can hold info on anyother type, but the size on a specific type prevents it from beeing usefull in comparison to the type intented to be used.
As for usage, it's kinda selv-documenting...
char, oh what do you know, it holds a single char or an int value from 0 - 255, given that it's 8 bit (or a byte if you want to count it that way)
int, oooh... let me guess, please let me, me, me, me..... I guess it would hold an integer... Yay what do I win....
double/float, is for fraction or floating values as it is known in the computer world.
Then theres ofcause all the further extension on the byte-size of the type, with long, unsigned, short.
But if you get any teaching book, I guarentee you it will hold a table with every type, its size, and what it's for.
|