is there is any way to access 3rd element of a linked list without using arrow operator??

Recommended Answers

Depends on how you made the linked list.

If you don't like arrow operators, though, you can dereference the pointer explicitly, like so:

(*a).something
is identical to

a->something

Jump to Post

All 4 Replies

Depends on how you made the linked list.

If you don't like arrow operators, though, you can dereference the pointer explicitly, like so:

(*a).something
is identical to

a->something

jow to traverse to the third element??

Depends on how you made the linked list. How did you make the linked list?

i made it like this
struct abc *p=new abc(5);
and in abc i have a pointer which points to next element

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.