Hi guys the below are the codes I have written. i am trying to return a struct back to int main() so that i can display the topstudent in there after comparing the score of the students in struct markTable
#include <iostream>
#include <string>
#include <iomanip>
using namespace std;
you have to declare the struct before you declare any functions returning it.
when you declare markRec getTopStudent(); the compiler doesn't know what markrec is yet because you don't define it until the next line. just switch these around.