Problem with error message creating an instance of a struct

This is the error I am getting on the "return *node1"
Error: no suitable conversion function from "BinaryTreeNode" to "int" exists

1
2
3
4
5
BinaryTreeNode* node1 = new BinaryTreeNode;
node1->left = NULL;
node1->right = NULL;
node1->freq = 15;
return *node1;



Last edited on
You're returning a BinaryTreeNode object by value from the function. Does it match your function signature or does the function expect an int return?
Topic archived. No new replies allowed.