Question: I keep gtting error and coode is not running: #include #include #include / / / @brief / / / @return int main ( ) {

I keep gtting error and coode is not running: #include
#include
#include
/// @brief
/// @return
int main(){
char *infilename = "roster.txt";
char *outfilename = "gradeReport.txt";
FILE *infile;
FILE *outfile;
int numStudents;
RECORD_TYPE **gradeRoster;
// Attempt to open the infile for reading
infile = fopen(infilename,"r");
if (infile == NULL){
printf("Error opening file %s for reading.
", infilename);
return 1;
}
// Attempt to open the outfile for writing
outfile = fopen(outfilename,"w");
if (outfile == NULL){
printf("Error opening file %s for writing.
", outfilename);
return 1;
}
// Read the number of students from the file
fscanf(infile,"%d", &numStudents);
// Allocate memory for gradeRoster
gradeRoster =(RECORD_TYPE **)malloc(numStudents * sizeof(RECORD_TYPE *));
if (gradeRoster == NULL){
printf("Memory allocation failed.
");
return 1;
}
// Call loadRoster function
loadRoster(infile, gradeRoster, numStudents);
// Declare and initialize choice variable
int choice;
do {
// Call menu function and collect choice
choice = menu();
// Call processChoice function
processChoice(infile, outfile, choice, gradeRoster, numStudents);
} while (choice !=4);
// Close files
fclose(infile);
fclose(outfile);
return 0;
}
this is error i keep getting
c:/mingw/bin/../lib/gcc/mingw32/6.3.0/../../../libmingw32.a(main.o):(.text.startup+0xa0): undefined reference to `WinMain@16'
collect2.exe: error: ld returned 1 exit status
PS C:\Users\foste\OneDrive\Desktop\COP2220>

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!