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;
RECORDTYPE gradeRoster;
Attempt to open the infile for reading
infile fopeninfilenamer;
if infile NULL
printfError opening file s for reading.
infilename;
return ;
Attempt to open the outfile for writing
outfile fopenoutfilenamew;
if outfile NULL
printfError opening file s for writing.
outfilename;
return ;
Read the number of students from the file
fscanfinfiled &numStudents;
Allocate memory for gradeRoster
gradeRoster RECORDTYPE mallocnumStudents sizeofRECORDTYPE ;
if gradeRoster NULL
printfMemory allocation failed.
;
return ;
Call loadRoster function
loadRosterinfile gradeRoster, numStudents;
Declare and initialize choice variable
int choice;
do
Call menu function and collect choice
choice menu;
Call processChoice function
processChoiceinfile outfile, choice, gradeRoster, numStudents;
while choice ;
Close files
fcloseinfile;
fcloseoutfile;
return ;
this is error i keep getting
c:mingwbinlibgccmingwlibmingwamaino:text.startupxa: undefined reference to WinMain@
collectexe: error: ld returned exit status
PS C:UsersfosteOneDriveDesktopCOP
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
