I am trying to figure out how to compare data within a struct when two is given as the following:
Node n1(10,10, "tens");
Node n2(20, 20, "twentys");
cout << n1.equal_nodes(n2) << endl;
cout << n1.equal_nodes(n1) << endl;
The struct being:
struct Node{
  int x;
  int y;
  string label;
  Node()=default;
  Node(int i, int j, string l) :  x(i), y(j), label(l) {} ;
  string to_string () const;
  bool equal_nodes(const Node&);
  double distance(const Node &)const;
};
Where I want my method to be:
bool Node::equal_nodes(const Node&) {
}
I am aware that the best way to go about the comparison is to compare the labels of the two nodes to see if they are the same, but I do not understand how to differentiate the data separately so that they can be compared.



equal_nodesinstead of implementingoperator==?n1andn2separately so I can compare them if they are the same or not. I am required to have my method beNode::equal_nodesdue to project requirements otherwise I would try and use theoperator==