title: function of searching a string from a file
body: <p>This is some code I wrote to check a <code>string's</code> presence in a file:</p>
  
  <pre><code>bool aviasm::in1(string s)
  {
  ifstream in("optab1.txt",ios::in);//opening the optab
  //cout&lt;&lt;"entered in1 func"&lt;&lt;endl;
  char c;
  string x,y;
  while((c=in.get())!=EOF)
  {
      in.putback(c);
      in&gt;&gt;x;
      in&gt;&gt;y;
      if(x==s)
      return true;
  }
  return false;
  }
  </code></pre>
  
  <p>it is sure that the string being searched lies in the first column of the <code>optab1.txt</code> and in total there are two columns in the <code>optab1.txt</code> for every row.
  Now the problem is that no matter what string is being passed as the parameter <code>s</code> to the function always returns false. Can you tell me why this happens?</p>