C/C++:0~9字元(char)轉成整數(int)

Jacky | Aug 30, 2022 min read

此內容由 Notion 編輯並經由 Notion API 自動轉成 Hugo 頁面
The content write by Notion, and use Notion API convert to Hugo page.

char a = '4';
int ia = a - '0';
/* check here if ia is bounded by 0 and 9 */

Refer

comments powered by Disqus