R
rakesh
Hi,
I have a requirement in which I need to search a string in a file
stored on a harddisk. String which needs to be searched would be
stored in a file with delimiter as new line character. some of the
ways of doing this are
1. Read each line and do string compare immediately.
2. Read each line, add each string into a stl vector and search for
the given string using stl bineary_search algorithm.
It would be helpful if someone could give me comparison of which would
be the best method among the above mentioned ways of handling
searching. I would also welcome any other better of handling searching
string in a file.
Thanks,
Rakesh.
I have a requirement in which I need to search a string in a file
stored on a harddisk. String which needs to be searched would be
stored in a file with delimiter as new line character. some of the
ways of doing this are
1. Read each line and do string compare immediately.
2. Read each line, add each string into a stl vector and search for
the given string using stl bineary_search algorithm.
It would be helpful if someone could give me comparison of which would
be the best method among the above mentioned ways of handling
searching. I would also welcome any other better of handling searching
string in a file.
Thanks,
Rakesh.