title: im counting the number of characters in a file but i want to count the number of words that are less than 5 and 6 or greater
body: <p>i want to do this:
  reads the words in the file one at a time.  (Use a string to do this)
  Counts three things: how many single-character words are in the file, how many short (2 to 5 characters) words are in the file, and how many long (6 or more characters) words are in the file. HELP HERE</p>
  
  <p>im not sure on how about reading file into a string. i know i have to something like this but i dont understand the rest. HELP HERE</p>
  
  <pre><code>ifstream infile;
  //char mystring[6];
  //char mystring[20];
  
   int main()
      {
          infile.open("file.txt");
              if(infile.fail())
              {
                  cout &lt;&lt; " Error " &lt;&lt; endl;
              }
  
          int numb_char=0;
          char letter;
  
                  while(!infile.eof())
                  {
                      infile.get(letter);
                      cout &lt;&lt; letter;
                      numb_char++;
                      break;
                  }
  
      cout &lt;&lt; " the number of characters is :" &lt;&lt; numb_char &lt;&lt; endl;
      infile.close(); 
      return 0;
  </code></pre>