c++ - Converting char to int '23' > 23 -
i have seen many post of how convert single digit int, how can convert more 1 digit number int, '23' convert 23;
to convert char array integer, use atoi()
. if converting strings, add .c_str()
after string variable convert suitable form use.
you can use stoi()
, provides additional features conversion, such specifying base.
Comments
Post a Comment