#include<iostream>
#include <string>
#include <sstream>
using namespace std;
int main(){
int i=0, ii = 0, x;
string input;
//command to prompt user for amount of movies
cout<< "How many movies do you want to add? ";
getline(cin,input);
//end command to prompt user for amount of movies
//set up loop situation to take the input from user and transfer it to X
stringstream(input)>> x;
//sets up array of however many X is with a limit of 50 characters
char lines[x-1][50];
char liness[ii][50];
system("cls");
while(i<x){
cout <<"Enter Movie # "<<i+1<<" : ";
cin.getline(lines[i], 50);
cout <<"Enter Rating: ";
cin.getline(liness[ii], 50);
system("cls");
i++;
ii++;
}
system("cls");
cout << "Results Are As Follows :" << endl << endl;
i = -1 ;
ii = -1;
for ( int z = 0; z <= x - 1;)
{
i++;
ii++;
cout << lines[i] << endl << "Rating : " << liness[ii] << endl << endl;
z++;
}
system("pause");
return 0;
}
I am trying to get a user to enter the amount of movies they want to store, then take the name of the movies and sort them alphabetically, and i am trying to figure out how to sort it with placeholders but am still having a problem and i also want to be able to sort them via rating so if anyone could point me in the right direction or help this scrubbie i would be most excited and appreciative.