title: How to compare two structure strings in C++
body: <p>Ok, so this week in class we're working with arrays. I've got an assignment that wanted me to create a structure for an employee containing an employee ID, first name, last name, and wages. Then it has me ask users for input for 5 different employees all stored in an array of this structure, then ask them for a search field type, then a search value. Lastly, display all the information for all positive search results.</p>
  
  <p>I'm still new, so I'm sure it isn't a terribly elegant program, but what I'm trying to do now is figure out how to compare a user entered string with the string stored in the structure... I'll try to give all the pertinent code below.</p>
  
  <pre><code>struct employee { int empid, string firstname, string lastname, float wage };
  employee emparray[] = {};
  employee value[] = {};
  
  //Code for populating emparray and structure, then determine search field etc.
  
  cout &lt;&lt; "Enter a search value: ";
  cin &gt;&gt; value.lastname;  
  
  for(i = 0; i &lt; 5; i++) {
  if(strcmp(value.lastname.c_str, emparray[i].lastname.c_str) == 0) {
      output();
  }
  }
  </code></pre>
  
  <p>Which... I thought would work, but it's giving me the following error.. </p>
  
  <pre><code>Error   1   error C3867: 'std::basic_string&lt;_Elem,_Traits,_Alloc&gt;::c_str': function call missing argument list; use '&amp;std::basic_string&lt;_Elem,_Traits,_Alloc&gt;::c_str' to create a pointer to member d:\myfile
  </code></pre>
  
  <p>Any thoughts on what's going on? Is there a way to compare two .name notated strings without totally revamping the program? IF you want to drill me on best practices, please feel free, but also please try to solve my particular problem.</p>