Why do I get one byte more reported? I do not have a newline at the end. I tested other files with similar result. Using linux 3.2.
$ cat testfile.txt aabbcd $ wc -c testfile.txt 7 testfile.txt
Similarly I get one more number of bytes reported if I use c++:
... file(filename, std::ifstream::in | std::ios::binary); file.seekg(0, std::ifstream::end); int fsize = file.tellg(); ...
The text aabbcd consist of 6 characters, in ASCII encoding that should be 6 bytes. Why do I get 7 bytes reported?
Note: I happend to have characters in the example, but I care only about the bytes, not text, not formatted input.