I have asked this question a few days ago:
How to look for an ANSI string in a binary file?
and I got a really nice answer, what later turned into a much harder question: Can input iterators be used where forward iterators are expected? what is now really not on a level what I could understand.
I am still learning C++ and I am looking for an easy way to search for a string in a binary file.
Could someone show me a simple code for a minimalistic C++ console program which looks for a string in a binary file and outputs the locations to stdout?
Possibly, can you show me
a version where the file is being copied to memory (supposing the binary file is small)
and an other one which uses the proper way from the linked questions
Sorry if it sounds like I'm asking for someone's code, but I am just learning C++ and I think maybe others could benefit from this question if someone could post some high quality code what is nice to learn from.