can we convert integer into character

后端 未结 6 1704
北海茫月
北海茫月 2020-12-19 08:06

we can convert character to an integer equivalent to the ASCII value of the same but can we do the reverse thing ie convert a given ASCII value to its character equivalent?

6条回答
  •  醉酒成梦
    2020-12-19 08:37

    To convert to/from:

    int i = 65;
    char c = (char)i;
    
    char c = 'A';
    int i = (int)c;
    

提交回复
热议问题