Hello guys, I'm doing a mini project about student admission data and currently my "case c" and "case d" is not running properly. Means the name and Id I try to search based on my InputData.txt is unsuccessful. Please help me to figure out any error on my coding, thank u very much.
lines 126-128,142-144: You're swapping only the student name. You have to swap the entire structure.
line 41: arraySize is an uninitialized variable.
Line 194: You're reading based on arraySize, but arraySize is garbage unless you've previous executed option a or c. Line 161 implies arraySize is written to the file, but you don;t account for it here.
line 159: Your title says you can;t open the input file, but I see no check here that the input file did or did not open successfully.
line 187: Your logic between C and D is inconsistent. In C, you read from the input file. You don't do so in D. I would suggest that you load the input file in only one place (F).
Your case branches are too big. Move your case branches into functions.