char a = '4';
int ia = a - '0';
/* check here if ia is bounded by 0 and 9 */
C/C++:0~9字元(char)轉成整數(int)
Jacky
|
Aug 30, 2022
min read
char a = '4';
int ia = a - '0';
/* check here if ia is bounded by 0 and 9 */