If the file isn't large, you could read it all into a char array (using read()) and the use http://www.cplusplus.com/reference/algorithm/search/ to find what you need.
Another way would be to read one byte. Then compare it to 67. If there's no match, repeat. If there is a match, read another byte and compare it to 45, and so on..
Use Boost regex, passing in a pair of istream_iterators. I'd suggest doing that with std::search, but it requires forward iterators, not input iterators. Boost regex supports searching with input iterators. Though the documentation is a bit ambiguous, I know it can be made to work. I've got code that reads and parses data from std::cin using streambuf_iterators.
That's interesting. You're right the iterator types don't match. That's a shame, it works on my Linux implementation. After the search is successful the input stream is only consumed up to (and including) the matched portion. But that evidently can't be relied upon...
A couple of things. First, my method has a fault as PanGalactic pointed out. It works on some systems but not others, so its not a good idea to use it. Second "\x0G" is not a HEX value. You shouldn't enter something like that into a string literal. I tried it on my system and it did not complain but it is equivalent to using an empty string "". An empty string is always found.
I'm using cygwin to compile and run the file, and it works perfectly.
Then I test it again, using QT creator, it builds fine, but when I run the program. It does not seem to work. I check to see if the program actually open the files, and it does, but it does not do the search.
So I'm guess this where PanGalactic pointed out applies?