View Single Post
Old Jul 19th, 2005, 12:57 PM   #6
skuinders
Hobbyist Programmer
 
skuinders's Avatar
 
Join Date: Jun 2005
Location: MA, US
Posts: 204
Rep Power: 4 skuinders is on a distinguished road
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!
__________________
"A stupid man's report of what a clever man says can never be accurate, because he unconciously translates what he hears into something he can understand."
- B. Russell

http://web.bryant.edu/~srk2

Last edited by skuinders; Jul 19th, 2005 at 1:23 PM.
skuinders is offline   Reply With Quote