Check out example codes for "converting char to integer c++". It will help you in understanding the concepts better.

Code Example 1

int x = std::stoi("42")

Code Example 2

int x = character - '0'

Code Example 3

int x  = '9' - 48;
// x now equals 9 as an integer

Learn ReactJs, React Native from akashmittal.com