hey everyone im having this little problem. Im trying to convert from a string to an int. ive tried to use atoi but that didnt work. that only works if it were char string[1] = "1"; int x; x = atoi(string);
however in my situation, i have something delcared as a string like this:

string x = "1";
int y;

y = atoi(x) // Will Not Work

my friend told me something like s.at() would work, but i dont know how to use that, so someone please help because this program is due tomorrow. thanx