d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Can Anyone Explain Literal Values For C#? Plz
Add Reply New Topic New Poll
Member
Posts: 34,590
Joined: Mar 25 2009
Gold: 12,633.00
Aug 12 2015 11:07pm
I don't understand it at all.... Literal values for datatypes... like literal values for integer, etc..... the book i'm reading didn't really explain it too well.... would appreciate some help!
Member
Posts: 32,925
Joined: Jul 23 2006
Gold: 3,804.50
Aug 13 2015 04:39am
numbers or string values you literally type.

int number = 10;

10 is literal.

string name = "ferf";

"ferf" is a string literal.

This post was edited by carteblanche on Aug 13 2015 04:47am
Member
Posts: 23,862
Joined: Aug 16 2006
Gold: 20.00
Aug 13 2015 04:16pm
Quote (carteblanche @ Aug 13 2015 05:39am)
numbers or string values you literally type.

int number = 10;

10 is literal.

string name = "ferf";

"ferf" is a string literal.



as opposed to:

Code
int a = 5;
int b = a; // b is now equal to 5 but 'a' is not an integer literal

Member
Posts: 34,590
Joined: Mar 25 2009
Gold: 12,633.00
Aug 13 2015 04:31pm
hmm thanks guys
Go Back To Programming & Development Topic List
Add Reply New Topic New Poll