class node
{
public:
int data()
{
return data_field;
}
node* link()
{
return link_field;
}
private:
int data_field;
node* link_field
};
Suppose we are using the node class definition listed above. Your program is using a node* variable called head_ptr to point to the first node of a linked list (or head_ptr == NULL for the empty list). Write a few lines of C++ code that will print all the integers in the list.