title: no matching function for call to Foo::Foo
body: <p>I believe this question has been asked before. I tried looking for it but still can't figure out the problem. I'd greatly appreciate any help I can get here. Thanks</p>
  
  <p>I get the following error. I get an idea that I am not initializing the Vertex once I call the constructor of the Edge. But I can't seem to figure out how. </p>
  
  <pre><code>10369.cpp: In constructor ‘Edge::Edge(Vertex, Vertex)’:
  10369.cpp:34: error: no matching function for call to ‘Vertex::Vertex()’
  10369.cpp:30: note: candidates are: Vertex::Vertex(int, int)
  10369.cpp:6: note:                 Vertex::Vertex(const Vertex&amp;)
  10369.cpp:34: error: no matching function for call to ‘Vertex::Vertex()’
  10369.cpp:30: note: candidates are: Vertex::Vertex(int, int)
  10369.cpp:6: note:                 Vertex::Vertex(const Vertex&amp;)
  
      #include &lt;iostream&gt;
      #include &lt;math.h&gt;
      using namespace std;
  
  //Vertex in a graph, with x &amp; y coordinates 
      class Vertex{
          int x , y;
          public:
              Vertex(int, int);
              ~Vertex();
  
              int GetX() {return x;};
              int GetY() {return y;};
  
      }; 
  
  // Edge of a graph calculated from two vertices
      class Edge{
          Vertex U , V;
          float edge_weight;
              public:
                  Edge(Vertex , Vertex);
                  ~Edge();
  
                   float GetEdgeWeight() { return edge_weight; }
  
  
      };
  
      Vertex::Vertex(int _x , int _y){
          x = _x;
          y = _y;
      } 
  
  // The edge weight is calculated using the pythagoras
      Edge::Edge(Vertex _U , Vertex _V){
          U = _U;
          V = _V; 
          int x = V.GetY() - U.GetY();
          int y = V.GetX() - U.GetX();
          edge_weight = sqrt(pow(x,2) + pow(y,2));
  
      }   
      int main (int argc , char *argv[]){
  
          Vertex V1(0,1) ; 
          Vertex V2(0,3);
          Edge E(V1, V2);
          float x = E.GetEdgeWeight();
          cout &lt;&lt; x &lt;&lt; endl;
  
  
          return 0;
      }
  </code></pre>