title: Find in C++ if a line from file contains a specific character
body: <p>I've read the lines from a textfile and i want to check if that line contains the $ sign.</p>
  
  <p>That's what i got so far:</p>
  
  <pre><code>int main() {
  
      ifstream data_store;
      string line;
      data_store.open("c:\\test.txt");
  
  
      while (!data_store.eof())
      {
  
          getline(data_store, line);
          if (line.find("$"))
          cout &lt;&lt; "1: " &lt;&lt; line &lt;&lt; endl;
      }
  
  
      data_store.close();
  
      system("PAUSE");
      return 0;
  }
  </code></pre>
  
  <p>Furthermore how can i output them to a file ?</p>