class A { public: A* next; } a1, a2, a3; void iterate(A* a) { iterate(a->next); } int main() { a1.next = &a2; a2.next = &a3; a3.next = &a1; iterate(&a1); return 0; }
iterate
Login in to like
Login in to comment
or Read more about C++ Quizzes
Login in to like
Login in to comment