here is a code about a circularlinklist,which its nodes contain a number between 1 to 2048(first node contains 1 and the lastnode contains 2048) and pointer P that refers to the last node...what does this code do?

while(p->next!=p){
p->next=p->next=->next;
p=p->next;
}
cout<< p->info;

> p->next=p->next=->next;
It doesn't do anything, because it won't compile.

Also, since you keep changing p, your condition will never fail (loop forever, chasing your tail like some demented dog).

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.