Int and char will report an error? ? ?

int num = 78999 + 'a';

Running result: 79096

why?

Baidu took a look at the ASCII code comparison table. It turned out that 78999 was added to the ASCII code of small a. The comparison table (decimal): az: 97-122, AZ: 65-90, 0-9: 48-57

 

Guess you like

Origin blog.csdn.net/qq_42407917/article/details/108529472