I have a program in were you enter numbers. each different # set you enter goes into an array ( section[] )
but now what I'm trying to do is add 2 different sections together.
for(int x = 0; x < stoppoint; ++x)
{
track = track + 1;
if(section[x] == "*")
{
answer = section[track - 1] + section[track + 1];
}
}
cout << answer;
}
as you see, im trying to add the numbers before the "*" and after the "*". but its not working. what happens is, if the #'s before and after the * are 1 and 3, it will display 13. I want it to display 4.
what am I doing wrong? thanks.