|
Your terminology is too fuzzy. An array of char, terminated by a '\0', is often referred to as a string, and atoi would accept that. The C++ string class is something else, but you can access its array of char with ElStringo.c_str (). Atoi isn't a great choice, since an error will return the same thing as the value, zero, so you can't tell the difference. There are other things like strtol, etc., that work better. You might also wish to investigate string streams.
|