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;
}*start;

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

next->marks=5;
next->regno=3456;

will this work?

Recommended Answers

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

Jump to Post

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 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.