2
Answers

C Sharp Intrinsic Types

F D

F D

14y
12.4k
1

Maybe someone can clarify for me. I'm a bit confused.

 

The question is which type should each of the following be and determine which should be represented with a constant

 

-Your age in years (I chose byte b/c of it being an unsigned value up to 255 thus using less memory, but my book (Learning C Sharp 3.0 by O"reilly) said short)

I can't make sense out of this. Could it be if the values of my age and others ages totaling more than 255, therefore needing more memory?  

 

-Speed of Light in meters per second (299,792,458)  - Couldn't quite figure this out so I said to make this a constant & long, book said constant & float.

I'm ok, but not 100% on this one. I understand the float as far as precision is concerned, but then why not a double? Could it be potential memory being wasted?  

 

Any information would be greatly appreciated.

 

Thanks.

Answers (2)
0
Suthish Nair
NA 31.7k 4.6m 14y
Is this query got resolved?
0
Sam Hobbs
NA 28.7k 1.3m 14y

Maybe you can clarify this for me; I'm a lot confused about your question.