This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Why char is unsigned?  RSS feed

 
Ja vardhan
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Friends,

Among all the primitives- only char is un-signed. Why???
Also Pls explain more about signed and unsigned concepts.

Thanks.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why would you want a character to be signed ? After all, the ascii/Unicode tables are not signed. If you'd like to use two bytes signed variables, you could use 'short'.

I don't think you need to ask 'why is it like this/ like that ?'. For example., "Why is a character variable called 'char' ? They could have called it 'bob'"

Just remember that char variables are unsigned, and other are signed
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ja vardhan:
... Also Pls explain more about signed and unsigned concepts...

See this thread.
[ December 26, 2005: Message edited by: marc weber ]
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!