title: no matching function for call to c++ string error
body: <p>I am trying this code to perform the following function : given an input file and a word(string) output should be the lines in the file containing the given word along with the line number. But I am getting an error saying "no matching function for call to ..." in the line where I am performing string operation (strstr). Here is my code. Please help me solve this. I am facing the same error in other programs also where ever I perform operations involving strings.</p>
  
  <pre><code>#include&lt;iostream&gt;
  #include&lt;fstream&gt;
  #include&lt;string.h&gt;
  #include&lt;stdio.h&gt;
  using namespace std;
  int main()
  {
  int x;
  char c;
  ifstream iFile1, iFile2;
  ofstream oFile;
  char file1[50], file[50];
  char word[50];
  cout &lt;&lt; "First file?\n";
  gets(file1);
  std::string str;
  
  cout &lt;&lt; "Word?\n";
  gets(word);
  iFile1.open(file1);
  
  while (std::getline(iFile1, str)) {
      x++;
      if (strstr(str, word)) {
          cout &lt;&lt; "%d\t,x";
          cout &lt;&lt; str;
      }
  }
  }
  </code></pre>
  
  <p>error: <code>no matching function for call to 'strstr(std::string&amp;,char[50])'
        if(strstr(str,word))
                         ^</code></p>