I'm using ifstream::read to read a file,
ifstream ifs("a.txt");
char buf[1024];
ifs.read(buf, 1024);
But a.txt's size might be less than 1000 bytes, so how am I supposed to know how many bytes have been read from ifs?
I'm using ifstream::read to read a file,
ifstream ifs("a.txt");
char buf[1024];
ifs.read(buf, 1024);
But a.txt's size might be less than 1000 bytes, so how am I supposed to know how many bytes have been read from ifs?