title: "No matching constructor for initialization of. . ."
body: <p>I recognize that this type of question has been asked, and I looked at those responses but still think I'm missing something.  I get this "No matching constructor error", because I don't have a constructor, but that being said, everything that I looked at about constructors said that you need them if you don't already include the variable names inside the class.  But I already did that, so do I need a constructor?  If I do, what should it look like then?  I'm new to C++, taking a class, and this is for an assignment.</p>
  
  <p>Here's my sensor_node.h file with the class declaration:</p>
  
  <pre><code>#ifndef SENSORNODE_H
  #define SENSORNODE_H
  
  #include &lt;iostream&gt;
  
  class LOCATION {
      float lat, longi, height;
  
  public:
      LOCATION (float lat, float longi, float height);
      void setx(float xx);
      void sety(float yy);
      void setz(float zz);
      void print();
  };
  
  class SensorNode {
      char* NodeName;
      int NodeID;
      LOCATION Node1;
      float batt;
      int func;
  
  
  public:
      SensorNode(char *n, float x, float y, float z, int i, float ah);
      void print();
      void setOK(int o);
      int getOK();
      void setLOC(float longi, float lat, float h);
  };
  
  #endif /* defined(__Project_3__sensor_node__) */
  </code></pre>
  
  <p>And here's my main.cpp with the error (On the line that says "LOCATION"):</p>
  
  <pre><code>#include &lt;iostream&gt;
  using namespace std;
  
  
  #include "sensor_node.h"
  
  int main() {
      LOCATION a; SensorNode s1("Pulse",15.9,-30.1,0,157,2.0);
      int hold;
  </code></pre>