Can ya'll take a look at this?
#include <iostream>
#include <string>
using namespace std;
int main()
{
string names[3] = {"John","Anne","Mary"};
int score[i];
cout << "Enter Scores" << endl << endl;
cout << "Anna Marie: ";
cin >> score[i];
//sort by score
for ( int i = 0; i < 3; i++ )
score[i];
{
for ( int j = 0; j < 3; j++ )
{
if ( score[i] < score[j] )
{
string tmp_string;
int temp;
temp = score[3];
tmp_string = names[i];
//now swap the names array
score[3] = score[j];
names[i] = names[j];
//now swap the names array
score[j] = temp;
names[j] = tmp_string;
//now swap the names array
}
}
}
//Ask for Scores
for ( int k = 0; k < 3; k++ )
{ cout << names[k] << " : " << score[k] <<endl;
} return 0;
}
It's saying the "i" in scores is undeclared?
What do I do?