Reverse singly linked list using C/C++