a*****k 发帖数: 704 | 1 int i = 8;
char c = i+'0';
为什么i+'0'后变成char? | G****A 发帖数: 4160 | 2 first, how did u know i+'0' 变成char?
【在 a*****k 的大作中提到】 : int i = 8; : char c = i+'0'; : 为什么i+'0'后变成char?
| a*****k 发帖数: 704 | 3 if I have a char s[]
when n<10,
s[i] = n + '0'; works
but s[i] = n doesn't work
【在 G****A 的大作中提到】 : first, how did u know i+'0' 变成char?
| a*****k 发帖数: 704 | 4 never mind, I got it.
it is for ascii code.
【在 a*****k 的大作中提到】 : if I have a char s[] : when n<10, : s[i] = n + '0'; works : but s[i] = n doesn't work
|
|