void BinarySearchTree::inorder(tree_node* p)
{
    if(p != NULL)
    {
        if(p->left) inorder(p->left);
        cout<<" "<<p->data<<" ";
        if(p->right) inorder(p->right);
    }
    else return;
}

This sample of code works fine if I use it to test valuables that are primitive, example: integer
I wanted to be able to transform that, so, if for example when I was using a class 'Product', which includes a Price (integer) and Description(string), would allow me to order the products per price.

If you could give me an idea how to make this possible I'd appreciate it.
Thanks.

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.