g labs\lab6.exe" -g3 -I"C:\Dev-Cpp\lib\gcc\mingw32\3.4.2\include" -I"C:\Dev-Cpp\include\c++\3.4.2\backward" -I"C:\Dev-Cpp\include\c++\3.4.2\mingw32" -I"C:\Dev-Cpp\include\c++\3.4.2" -I"C:\Dev-Cpp\include" -L"C:\Dev-Cpp\lib" -g3
C:\Users\Glenda hayes\Documents\c++ programing labs\lab6.cpp: In function `void sortArray(float*, int)':
C:\Users\Glenda hayes\Documents\c++ programing labs\lab6.cpp:56: error: overloaded function with no contextual type information
C:\Users\Glenda hayes\Documents\c++ programing labs\lab6.cpp:56: error: invalid operands of types `<unknown type>' and `int' to binary `operator>'
C:\Users\Glenda hayes\Documents\c++ programing labs\lab6.cpp:56: error: no post-increment operator for type
C:\Users\Glenda hayes\Documents\c++ programing labs\lab6.cpp: At global scope:
C:\Users\Glenda hayes\Documents\c++ programing labs\lab6.cpp:70: error: expected declaration before '}' token
Execution terminated
------------------------------
#include <iostream>
#include <fstream>
using namespace std;
//this program is going to output the student id and gpa in accending order
//function prototype
void sortArray(float,int);
int main()
{
const int SIZE= 100; //Array size
int id[SIZE];
int GPA;
int j;
ifstream inputFile;
char dataFile[20];
inputFile.open("dataFile.txt");
char fileName[20];
cout<<" The file name is GPA.txt";
ofstream outputFile;
outputFile.open("GPA.txt");
cout<<id<<endl;
cout<<GPA<<endl;
for(j = 0; j< SIZE; j++)
{
cout<<"please enter the student id number"<<endl;
cin>>id[j];
cout<<"please enter the gpa. "<<endl;
while(GPA!=99)
{
cout<<"please enter the gpa. ";
cin>>GPA;
cout<<GPA;
}
sortArray(GPA, SIZE);
inputFile.close();
outputFile.close();
system("pause");
return 0;
}
When you use a {, indent your code. This will enable you to see when you have missed a closing }, as in the code below, which is your code, but indented to enable you to see the missing }.
int main()
{
constint SIZE= 100; //Array size
int id[SIZE];
int GPA;
int j;
ifstream inputFile;
char dataFile[20];
inputFile.open("dataFile.txt");
char fileName[20];
cout<<" The file name is GPA.txt";
ofstream outputFile;
outputFile.open("GPA.txt");
cout<<id<<endl;
cout<<GPA<<endl;
for(j = 0; j< SIZE; j++)
{
cout<<"please enter the student id number"<<endl;
cin>>id[j];
cout<<"please enter the gpa. "<<endl;
while(GPA!=99)
{
cout<<"please enter the gpa. ";
cin>>GPA;
cout<<GPA;
}
sortArray(GPA, SIZE);
inputFile.close();
outputFile.close();
system("pause");
return 0;
}