title: error: no matching function for call to const
body: <p>My main() want to call </p>
  
  <pre><code>program p;   
  p.isPath("c9", "c5")
  </code></pre>
  
  <p>program.h has </p>
  
  <pre><code>stack&lt;City&gt; isPath(City, City);
  </code></pre>
  
  <p>program.cpp has</p>
  
  <pre><code>stack&lt;City&gt; Program::isPath(City originCity, City destCity)
  {
          stack&lt;City&gt; flight; // = new Stack&lt;City&gt;();
          originCity.setVisited(true);
          flight.push(originCity);
          checkPath(&amp;originCity, &amp;destCity, &amp;flight);
          return flight;
   }
  </code></pre>
  
  <p>stack of city is created and cities added in stack as:</p>
  
  <pre><code>Program::Program()
  {
  City* c1 = new City("C1");
  City* c2 = new City("C2");
  City* c3 = new City("C3");
  City* c4 = new City("C4");
  City* c5 = new City("C5");
  City* c6 = new City("C6");
  City* c7 = new City("C7");
  City* c8 = new City("C8");
  City* c9 = new City("C9");
  Program::found = true;
  
  list&lt;City&gt;* allCities = new list&lt;City&gt;();
  this-&gt;allCities-&gt;push_back(*c1);this-&gt;allCities-&gt;push_back(*c2); this-&gt;allCities-&gt;push_back(*c3);allCities-&gt;push_back(*c4); this-&gt;allCities-&gt;push_back(*c5);
  this-&gt;allCities-&gt;push_back(*c6); this-&gt;City destCityallCities-&gt;push_back(*c7); this-&gt;allCities-&gt;push_back(*c8); this-&gt;allCities-&gt;push_back(*c9);
  
  c1-&gt;addCityToCities(c7);
  c1-&gt;addCityToCities(c2);
  c2-&gt;addCityToCities(c3);
  c3-&gt;addCityToCities(c4);
  c4-&gt;addCityToCities(NULL);
  c5-&gt;addCityToCities(c7);
  c6-&gt;addCityToCities(c5);c7-&gt;addCityToCities(c6); c7-&gt;addCityToCities(c8);c8-&gt;addCityToCities(c2); c8-&gt;addCityToCities(c9);c9-&gt;addCityToCities(c6);
  </code></pre>
  
  <p>City class has following code:</p>
  
  <pre><code>City::City()
  {
  list&lt;City&gt;* cities = new list&lt;City&gt;();
  }
  City::City(string _name){
    this-&gt;name = _name;
    list&lt;City&gt;* cities = new list&lt;City&gt;();
    visited = false;
  </code></pre>
  
  <p>I am having this error message</p>
  
  <pre><code>main.cpp:  error: no matching function for call to 'Program::isPath(const char [3], const char [3])'
  main.cpp:  note: candidate is:
  \include\Program.h: note: std::stack&lt;City&gt; Program::isPath(City, City)
  \include\Program.h: note:   no known conversion for argument 1 from 'const char [3]' to 'City'
  </code></pre>
  
  <p>This is travelling salesman application. Could anybody help me resolve this error please.</p>