Okay so I have read in the values and stored them in an array. I can't figure out how to reverse those values stored in the array without declaring another array or just printing it out backwards. PLEASE HELP
#include <iostream>
#include <string>
using namespace std;
void display(string wordArray[], int low, int high);
int main() {
int low;
int high;
int range;
string words[20];
display(words, 0, 19);
cout<<"Enter lower bound and upper bound so that 0 <= lower bound <= upper bound < 10:"<<"\n";
cin>>low;
cin>>high;
range=(high-low) + 1;
cout<<"Enter "<<range<<" words:"<<"\n";
for (int i=low; i<= high; i=i+1) {
cout<< "[" <<i<<"]:"<<"\n";
cin>>words[i];
}
void display(string wordArray[], int low, int high) {
int i;
for (i = low; i <= high; i = i + 1) {
cout << "[" << i << "]: '" << wordArray[i] << "'\n";
}
}
Swap the first element with the last element. Then swap the second element with the second-to-last element. Continue to do this until you've swapped all the way down to the middle of the array. Then, your array should be the reverse of what it was when you started.
You need to copy and paste the exact error and show us the exact code and tell us what line the error is referring to. Also, use code tags: http://www.cplusplus.com/articles/jEywvCM9/