+ 7

Can anybody explain me this challenge question?

Challenge question: why is the output 'j' or "j"? https://code.sololearn.com/c18IGh19O5Cz/?ref=app

21st Sep 2017, 12:15 AM
Prop de Puppy
Prop de Puppy - avatar
10 Respostas
+ 8
@kddavidson in the ascii table 'i' comes after 'j' see http://www.asciitable.com/mobile/ ... its 106 decimal vs 'i' is 105 decimal.. hope that helps
21st Sep 2017, 12:15 PM
cyber33
cyber33 - avatar
+ 6
Thanks all for answering, I really need to study this more!!
21st Sep 2017, 12:28 AM
Prop de Puppy
Prop de Puppy - avatar
+ 2
You can scroll down and view correct answers
21st Sep 2017, 2:31 AM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar
+ 2
Yeah much clear now thanks
21st Sep 2017, 11:03 PM
Prop de Puppy
Prop de Puppy - avatar
0
Im confused, how is int 1 + char i = char j? Shouldnt it throw exception? Does cpp assume english alphabet? Or refer to the unicode number (as the cpu would see a char) for letter i when derefferened? ( I think I may have just answered my own question? but a confirmation would be awsome) If anybody could please explain I would appreciate it...
21st Sep 2017, 7:36 AM
kddavidson
kddavidson - avatar
0
I realized unicode might be why as I wrote the last sentence lol. Thank you for for confirming.
21st Sep 2017, 1:33 PM
kddavidson
kddavidson - avatar