atoi(text[0]) will not work because atoi expects a char*, not a char. That half of NeoKyrgyz's answer was basically useless and dumb.
If you want to convert the character "c" representing the decimal digit n to the integer n, you can do so with (c - '0') . That's the same as what NeoKyrgyz said, because '0' is just a fancy way of writing 48 . You'll note that '0' == 48, '1' == 49, ..., '9' == 57. If text is a string containing "0R14", then text[0] will evaluate to 48.
atoi is for converting c-style strings containing sequences of digits into numbers, e.g. "123" -> 123
Reputation Points: 1135
Solved Threads: 172
Super Senior Demiposter
Offline 2,479 posts
since Jun 2005