I have a pretty big program that I need to put into pointer notation. I really don't even know where to start. The program has 4 functions. After I learn how to do the first function, I'm sure I'll be able to do the rest on my own, I just need help starting it.
Code:
int main()
{
void sort( int [], int );
int i, score[25], n = 0;
// Input
cout << "Enter first score: ";
cin >> score[n];
while( score[n] != -999 )
{
n++;
cout << "Enter Score (-999 to end): ";
cin >> score[n];
}
// Sorted Scores
sort( score, (n-1) );
cout << "Sorted scores:\n";
for(i=0; i<n; i++)
{
cout << score[i];
if(i<(n-1)) cout << ", ";
cout << endl << endl;
}
void sort( int a[], int n ) // Function header
{
int i, j, temp;
for(i=0; i<n; i++)
{
for(j=(i+1); j<=n; j++)
{
if( a[j] > a[i] )
{
temp = a[i];
a[i] = a[j];
a[j] = temp;
}
}
}
return;
}