How to create a Linked list with multiple variable

How to create a linked list of size 6 that keeps
following id values: "01", "02", "03", "04","05","06"
following age values: 30, 41, 50, 35, 55, 22
following marks values: 55.50, 80.0, 90.90, 30.30,70.0,69.9


#include <iostream>
using namespace std;


class ListNode {
public:
string id;
int age;
float marks;
ListNode *next;
};

int main()
{
ListNode *node1 = new ListNode;
node1->id = "01";
node1->age = 30;
node1->marks=55.50;

node1->next = new ListNode;

next->id ="02";
next->age=41;
next->marks=80.0;


node1->next->next = new ListNode;





return 0;
}
Encapsulate id,age and marks in a struct or class called Student say. Then have a linked list of Student's?
Are you required to write your own list class - or can you use the existing C++ std::list http://www.cplusplus.com/reference/list/list/
Topic archived. No new replies allowed.