Quote:
|
Originally Posted by Broax
Why are there so many data types? like short, long, int, string, etc. Is it to save memory on larger and more complex programs? Why not just use string and int for everything?
|
Well, you couldn't simply use string and int for everything... sometimes you want to deal with floating point numbers or single characters or the integer value of a char - and the list goes on and on.
Things like long, short, float, double are basically used to limit the amount of memory assigned to store the value. These can be used to save memory or sometimes limit the size or precision of a number.
-This is a very simple response as I expect you will figure out the more subtle features of data types in your studies. Happy hacking!