some question about std::string

(int)address1[j] == 64
why "@"=64
(int)phonenumber1[0] == 48
why "48"=0

Is it related to the function atoi?
Characters are represented via their ASCII code (e.g. 48 -> 0, 64 -> @, etc).

When you cast this to an integer, you simply get the ASCII code as a numeral, rather than the character it represents.

It has no relation to atoi.
Topic archived. No new replies allowed.