title: How to define a function that returns a string outside a struct it was declared in
body: <p>I am having trouble getting my code to work, and not sure how to solve this problem.</p>
  
  <pre><code>#include &lt;string&gt;
  struct car{
  std::string car_name;
  std::string get_name(void);
  };
  
  car::std::string get_name(){
  return car_name;
  }
  </code></pre>
  
  <p>Gives me error " error: 'std' in 'struct car' does not name a type car::std::string get_name(void)"</p>