You are confusing strings and arrays. You do not need 100 strings. Just two: org_word and back_word.
BTW, I would also get rid of the habit of using abbreviated names like that. Type stuff out:
1 2 3 4
|
int main()
{
string forward_string;
string reversed_string;
|
For your exercise there are quite a few different things you can do.
Usually professors expect someone to reverse a string “in-place”, meaning you modify the input string.
But it is perfectly fine to do it with two stings too.
Your compiler should have complained at you, at the very least on line 22. Fix line 9 to
not be an array and that problem should be fixed.
The more pressing problem is that you need to think a little more about the algorithm. I recommend you get a piece of paper and a pencil and practice making it work, yes,
by hand, with a string that is three characters long and then with a string that is four characters long.
You must be careful of
bounds: do not try to index characters outside the string (< 0 or >= len)
Hope this helps.