If you just need the whole files content, without any line-breaks etc, reading it in binary mode is the way to go. Then you can copy it into a std::vector < char > , and use std:: algorithms on it. -- "My opinions may have changed, but not the fact that I am right." Found in the sig of Herbert Kaminski