Click here to Skip to main content
15,888,113 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
please... i am a .net learner. i want to know where i can use the different types of datatypes in the different domins real time..

What I have tried:

i think very much ].. but i cont get the real time examples for the data types execpt only positive numeric datatypes. im not getting the examples for data types whos has both positive and negative values for sbyte, int, short, long and all other datatypes in c#.net
Posted
Updated 1-Mar-20 1:37am
Comments
ZurdoDev 23-Jun-16 11:52am    
Currency, if you are storing a balance, for example, will use negatives.

Not really sure what you are asking us.
Richard MacCutchan 23-Jun-16 13:00pm    
The int type can hold both positive and negative numbers. But it is unclear what your problem is, or waht you mean by "real time".
BillWoodruff 23-Jun-16 13:36pm    
Your question does not make sense. The integral types can be used anywhere, for any purpose.
prashureddy 24-Jun-16 7:08am    
may be anywhere... but where exactly in the real world?? in distance measurement, or force between two materials and while calculating gravity of an object.
where a programmer use these data types in real world projects?

1 solution

I think a little reading is in order for you. You can see a detailed explanation of each of these types in this link:

Value Types (C# Reference)[^]

Real time application of each of these types is defined by the size of the data that you are going to be placing in the variable. (i.e. If you are using a whle number between -128 and 127 then you can use an sbyte while a short will allow you a range of -32,768 to 32,767, etc.) All the information is in the link I provided.
 
Share this answer
 
v2
Comments
prashureddy 23-Jun-16 12:28pm    
we are using byte to store age because age minimum 0 and may be max 255, ushort to store student id from 0 to 65535.. sbyte to store floor numbers -120 to ground 120th floor and +120 to up 120 floor....

my question is there were any other realtime examples for these datatypes of C#.net..??
plese share because i don't know the all domains where we can use that datatypes.
Foothill 23-Jun-16 17:56pm    
A real world example of uses for negative integer numbers are coordinate systems, 3D graphics processing, and matrix calculations. I myself have never found a reason to use a signed byte.
prashureddy 24-Jun-16 7:05am    
ok. thank you

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900