www.digitalmars.com         C & C++   DMDScript  

D - Error: not enough data in stream

The following code terminates with the above error prior to reading the last
word from the file regardless of filesize.
___________
import stream;

int main()
{
  char[] str;
  File file = new File("words.dat");

  while(!file.eof())
  {
    file.scanf("%.*s", &str);
    printf("%.*s\n", str);
  }
  return 0;
}

Andrew
Nov 27 2002