In my development com there's no issue of handling 4MB of text file data but it took about 1-2mins for my program to finish.
I got a few questions here:
Q1-> how much can this string "line" store?
Q2-> should i use sstrm.clear() and line.clear() inside the while loop or only the sstrm.clear() inside the while loop then use line.clear() out of the while loop?
Q3-> do i really need to use .clear() on both the string for line and sstrm?
Q4-> or should i use other type of "get" to handle this 4MB text file?
Thanks in advance.
string line;
string match("sample");
while (getline(4MBfile, line))
{
stringstream sstrm(line);
string::iterator iter =search (
line.begin(),
line.end(),
match.begin(),
match.end()
);