My C++ overloading does not act as I assume it should:
#include "Node.h"
#include <iostream>
Node::Node()
{
cout << "1" << endl;
Node(Game(), 0.0);
}
Node::Node(double v)
{
cout << "2" << endl;
Node(Game(),v);
}
Node::Node(Game g, double v)
{
cout << "3" << endl;
numVisits = 0;
value = v;
game = g;
}
And the output from:
Node n(16);
cout << n.value << endl;
is 0, when it should be 16.
What am I doing incorrectly?