• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Why char is unsigned?

 
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 ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic