Ask your own question, for FREE!
Computer Science 15 Online
OpenStudy (anonymous):

C++ trouble char c='8'

OpenStudy (anonymous):

calculate: c-'0'

OpenStudy (anonymous):

@ganeshie8 @quickstudent @emmigrace222 @ParthKohli @Abhisar @hartnn @cwrw238

OpenStudy (quickstudent):

Please don't ask me, I don't know anything about computer science.

hartnn (hartnn):

that will actually subtract 0 from 8, giving you 8 like if you do '8'-'2' output will be 6

OpenStudy (anonymous):

to expand a bit on @hartnn's answer: char c = '8' is actually 1 byte that, assuming ASCII character encoding, will have the value of 38 hex (or 00111000 in binary, you can consult http://www.asciitable.com/ for details). '0' has hexadecimal value of 30 (or binary 00110000). Now if you do 38h - 30h you will get 8h. Going back to our ASCII table that is the character that represents that backspace. Hope this helps :)

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Latest Questions
Mari103: How to pop out like a Jacc In the box
5 minutes ago 0 Replies 0 Medals
Breathless: Spooky witch but cute
7 hours ago 3 Replies 0 Medals
Arriyanalol: help
6 hours ago 10 Replies 2 Medals
Arriyanalol: @tinydinoUwU stop trying to find a argument u blad lil boy
1 day ago 5 Replies 4 Medals
Jaded012023: Please tell me what you all think of this song
9 hours ago 6 Replies 1 Medal
Arriyanalol: bro how
9 hours ago 2 Replies 3 Medals
Arriyanalol: cant wait for the new bluey movie in 2027
1 day ago 12 Replies 2 Medals
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!