#include <iostream>

class Test
{
	public:
		Test(int _data, Test *_next = nullptr):data(_data), next(_next)
		{}
		int data;
		Test *next;
};

int main() 
{
	Test test_node1(1);
	Test test_node2(2);
	Test test_node3(3);
	
	test_node1.next = &test_node2;
	test_node2.next = &test_node3;
	
	for (Test *curr_node = &test_node1; curr_node != nullptr; curr_node = curr_node->next)
	{
		std::cout<<"Data: "	<<curr_node->data<<std::endl;
	}
	
	return 0;
}