struct student
{
char name[20];
int math;
int science;
int history;
int english;
int total;
}

how to create linked list that sort the details based on total in acsending order and how to prompt tot user to enter the student amount and marks between 0and100 just tell me the way .(C++)

1. Define the < operator for the student class and add the objects to a std::list.
2. Call the sort function of std::list and the list will be sorted.
3. Use std::cout to prompt the user, and std::cin to read the user input.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.