Forum     

Go Back   Digit Technology Discussion Forum > Software > Software Q&A
Register FAQ Calendar Mark Forums Read

Software Q&A Having trouble with software? Find solutions here


Closed Thread
 
LinkBack Thread Tools Display Modes
Old 30-04-2010, 09:56 AM   #1 (permalink)
In The Zone
 
rajwansh2003's Avatar
 
Join Date: Aug 2006
Location: RANCHI-BOKARO
Posts: 219
Default simple programming question.


why there are so many data types and why limitation of range
__________________
Anupam
rajwansh2003 is offline  
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 30-04-2010, 10:44 AM   #2 (permalink)
paralinux
 
Join Date: Jul 2008
Location: Noida
Posts: 86
Default Re: simple programming question.

well your question is not clear ...

data types are there to help you manage your data ... after all you cant store every information in one kind of storage ... categorization is the basic step of management.

limitation of range .. hmm... the variables that you create are stored in RAM .. now this is a finite resource .. you won't want one variable to occupy your entire memory, would you?
so there is a size of every variable .. the amount of bytes a variable can occupy... this helps efficient usage of memory.

was your question an attempt of sarcasm towards the existing programming languages or was it an authentic query?
__________________
http://bhanuvrat.blogspot.com

Digit Community Advisory Council
anuvrat_parashar is offline  
Old 30-04-2010, 02:05 PM   #3 (permalink)
Apprentice
 
anzaan's Avatar
 
Join Date: Oct 2006
Location: bangalore
Posts: 73
Default Re: simple programming question.

why there are so many data types and why limitation of range

y so many datatypes?
it is required to define the kind of data u r storing in memory. requried bcoz wen u want to perform some kind of operartion on tat data (eg. addtion or division) u shld knw if tat memory location has integer data or a character data or anythgn else. bcoz if u gonna perform divison on characters the output wuld make no sense and undesired too.

y limitation of range?
lets discuss this a bit.
the memory is divied into bits. once we decide tat we need to define types of data being stored, next we should define hw mch(max) of memory will each type of data shall occupy. this is required bcoz one shld knw before storing data that sufficient memmory is available. if we knw the required amt of memory , we can compare with the available memory n find out if sufficient free memory is available or not. next issue is the range. we decide on maximum range rather than minimum. we decide to give limited amount of memory(bits) for each type of data(datatype). the number of bits will decide the maximum range of value it can store(every data is converted into binary bits n then stored in memory). for example for datatype 'long' we give 8 bytes. but if the numbers tat we normally store say ranges between -30000 to +30000 half of the bits will be wasted. thus we create a smaller range n call it 'int'. tats how float and double were decided. 'char' is given a fixed and small memory space 1byte per character.
__________________
d a m n ! !
anzaan is offline  
Old 01-05-2010, 12:10 AM   #4 (permalink)
paralinux
 
Join Date: Jul 2008
Location: Noida
Posts: 86
Default Re: simple programming question.

@anzaan
a detailed explanation .. clears every doubt !!!
__________________
http://bhanuvrat.blogspot.com

Digit Community Advisory Council
anuvrat_parashar is offline  
Old 01-05-2010, 05:23 PM   #5 (permalink)
In The Zone
 
rajwansh2003's Avatar
 
Join Date: Aug 2006
Location: RANCHI-BOKARO
Posts: 219
Default Re: simple programming question.

thanks....
__________________
Anupam
rajwansh2003 is offline  
Old 03-05-2010, 09:57 PM   #6 (permalink)
Apprentice
 
anzaan's Avatar
 
Join Date: Oct 2006
Location: bangalore
Posts: 73
Smile Re: simple programming question.

Quote:
Originally Posted by anuvrat_parashar View Post
@anzaan
a detailed explanation .. clears every doubt !!!
thanks..

Quote:
Originally Posted by rajwansh2003 View Post
thanks....
always welcome..
__________________
d a m n ! !
anzaan is offline  
Closed Thread

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
One Simple Question! toofan Chit-Chat 5 11-03-2010 11:43 AM
Please someone answer this simple question Harvik780 Chit-Chat 6 17-05-2007 10:06 AM
A Simple Question ... bongourav Mobiles and Tablets 19 18-04-2007 12:50 AM
Anybody can answer these hard questions?<<@@@>> Urgent Pleas khin007 QnA (read only) 7 18-04-2005 12:42 AM

 
Latest Threads
- by Tenida
- by gohan89
- by ico
- by clinton
- by Sujeet

Advertisement




All times are GMT +5.5. The time now is 09:58 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2