Is there a way to pipe a file of (bytes- obviously) in to a C++ application on Linux. However, rather than just use getline()
I would like to read each byte only once. For example I don't want to use getline()
because it would read all the bytes up to the '\n' and then I would also have to re-read the bytes given to me via getline()
, so the bytes are read twice. I would just like to "iterate" through each byte once.
What would be the best-performing technique, to read PAGE_SIZE bytes at a go? Any example code is most welcome!