title: Data File handling in classic c++ (much like C)
body: <p>I made the following program. There is a mistake in bold part. The value of count in the output I'm getting is zero. There were no errors when I compiled the code.</p>
  
  <pre><code>#include&lt;iostream.h&gt;
  #include&lt;conio.h&gt;
  #include&lt;fstream.h&gt;
  void main()
  {
      clrscr();
      void count();
      fstream file("STORY.TXT",ios::in|ios::out);
      file&lt;&lt;"He is playing in the ground. She\nis playinbg with her dolls.\n";
      file.close();
      count();
      getch();
  }
  void count()
  {
      ifstream file("STORY.TXT");
      file.seekg(0);int count=0;
      while(!file.eof())
      {
          char line[10];
          **file.get(line,10,' ');
          cout&lt;&lt;line&lt;&lt;"\n";
          if(line=="HE")
              ++count;**
      }
      cout&lt;&lt;count;
      file.close();
  }
  </code></pre>