Hi all,

can i store multiple data items inside a doubly linked list?

is this valid?

struct node
    int marks;
    int regno;
    struct node *next;
    struct node *prev;

If this is valid, how can i assign values to the individual data items?


will this work?

Recommended Answers

All 3 Replies

or using a class or struct to bind the different data members would be ideal?

Sure, it will work. If next is not null that is...

Thanks @ddanbe

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.