diff options
author | Alon Zakai <alonzakai@gmail.com> | 2011-12-20 19:53:24 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2011-12-20 19:53:24 -0800 |
commit | 9f00292b7c7fa0cf69b8704c23b092811a9f9cc1 (patch) | |
tree | 8fb3478da53b0b168a0afe657a681a04d24c1d39 /tests/files.cpp | |
parent | 7953c8c6b8911647de68b4f22206650672cbca0a (diff) | |
parent | 78fde14808c0b075bd040d23b1d8cfb349c7cd84 (diff) |
Merge branch 'master' into incoming
Diffstat (limited to 'tests/files.cpp')
-rw-r--r-- | tests/files.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/files.cpp b/tests/files.cpp index d692ce67..e1a38421 100644 --- a/tests/files.cpp +++ b/tests/files.cpp @@ -28,6 +28,18 @@ int main() fclose (file); free (buffer); + // Do it again, with a loop on feof + + printf("loop: "); + file = fopen("somefile.binary", "rb"); + assert(file); + while (!feof(file)) { + char c = fgetc(file); + if (c != EOF) printf("%d ", c); + } + fclose (file); + printf("\n"); + // Standard streams printf("input:%s\n", gets((char*)malloc(1024))); |