if( strcmp(z->Rev->x.y,z->x.y) > 0)

In this statement i want to swap the pNext and pPrev. How will be the assignment look like?

C Programming: How to change position of nodes in a link list?
How to change position of nodes in a link list?

if( strcmp(current->Next->a.data,current->a.data) < 0){

I want current->next to be the current and current to be the current -> next?
How to do it?What is the assignment?
How to swap positions or links like this

Not swapped
(C B A )

Swapped

(A B C)

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.