Is there a function that returns the ASCII value of a character? (C++)

前端 未结 5 1130
生来不讨喜
生来不讨喜 2020-12-31 05:14

I need a function that returns the ASCII value of a character, including spaces, tabs, newlines, etc...

On a similar note, what is the function that converts between

5条回答
  •  误落风尘
    2020-12-31 05:36

    If you want to get the ASCII value of a character in your code, just put the character in quotes

    char c = 'a';
    

提交回复
热议问题