November 28, 2002 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 |
Copyright © 1999-2021 by the D Language Foundation