Deciding which type to use?
Posted on 2004-11-18
I was wondering which is the best type to use, let me explain... When ever i am using an integer for example then I would generally use int (int32) for example
But what if i need to only store either 0 or 1, then is it better to use a Byte type rather than another type or an int?
This does seem pretty logical to me but before making mistakes i thought i would ask.
Basically the rule should be use the smallest int possible or use a byte etc..., takes up less space in memory but what about optimisation, using a byte wouldn't take more time to run than using say an int (int32)??
Just wanted some clarification