arrays

can someone please tell me how to covert a character string into an integer array?
So what's your input string?

"ABC" and you want the integer ASCII values 65,66,67 stored in an integer array?

"123,456" and you want the comma separated values 123 and 456 stored in an integer array?

What have you tried?
maybe you mean this
stoi or atoi. First is for string type of c++, second is for C-string.
string anint = "123";
int val = stoi(anint);


but your question is confusing because of the array part. what is in the string, and what is supposed to be in the array? This could require you to parse the string yourself -- which basically means take the numeric substrings out and do the above to each one.
Last edited on
Topic archived. No new replies allowed.