For this assignment, I have to reverse whatever the user has input.
So, if the user were to input:
I have to make a program that outputs:
This is my code so far, but it's got a few.. 'quirks'(?) in it.
using namespace std;
cout << "Enter anything you want reversed: " << endl;
for (i = 0; i < 10; i++)
if (score[i] == '\n')
cout << "You have entered: " << endl;
for (i = 9; i >= 0; i--)
First of all, I'm using get() and put() so that the program will read spaces the user has input. Also, the size of the array has to be 10.
However, if you compile this code, you'll notice that while it does reverse whatever I input, it'll sometimes give me some weird characters before showing me what I've input in reverse.
Also, once it's shown the input in reverse, the cursor will keep blinking instead of just ending the program.
These are the instructions:
You should limit the amount of data being stored in your array to 10 values. After
you read and store 10 or less values in your array from the terminal, ignore any other input.