Adding char and int

前端 未结 7 2054
梦如初夏
梦如初夏 2020-11-30 10:51

To my understanding a char is a single character, that is a letter, a digit, a punctuation mark, a tab, a space or something similar. And therefore when I do:

7条回答
  •  离开以前
    2020-11-30 11:14

    Number 1 is ASCII code 49. The compiler is doing the only sensible thing it can do with your request, and typecasting to int.

提交回复
热议问题