title: C++ Creating a 2 Parameter Constructor
body: <p>I've written a program to display a company's name and report name, however, I need to make it so that if someone does not enter anything the program displays two default names. I need to add a constructor with 2 parameters. I find that I'm confusing myself, and getting more and more lost. I've tried making my code look like that of the textbook example, but to no avail. Could someone please give me some pointers and a direction? </p>
  
  <p>I am using C++ in Microsoft Visual Studios Express 2012, and here is my current code. </p>
  
  <pre><code>//This program displays a company's name and report. 
  #include &lt;iostream&gt;
  #include &lt;string&gt;
  using namespace std;
  
  
  
  class Heading
  {   
  private:
      string company;
      string report;
  
  public:
  
      void storeInfo (string c, string r);
  
      string getCompany()
      {
          return company;
      }
      string getReport()
      {
          return report;
      }
  };
  
  void Heading::storeInfo(string c, string r)
  {
  company = c;
  report = r;
  }
  
  void storeInfo(Heading&amp;);
  void showInfo(Heading);
  
  int main()
  {
  Heading company;
  
  storeInfo(company);
  showInfo(company);
  
  cin.ignore();
  cin.get();
  
  return 0;
  }
  
  /*****storeInfo*****/
  void storeInfo(Heading &amp;item)
  {
  string company;
  string report;
  
  cout &lt;&lt; "\nPlease enter the company name.\n";
  getline(cin, company);
  
  cout &lt;&lt; "\nPlease enter the report name.\n";
  getline(cin,report);
  
  item.storeInfo(company, report);
  }
  
  /*****showInfo*****/
  void showInfo(Heading item)
  {
  cout &lt;&lt; item.getCompany() &lt;&lt; endl;
  cout &lt;&lt; item.getReport();
  }
  </code></pre>