I apologize if this question is a bit vague or just plain stupid, I am still very much a novice.
I need to extract information from a web log file in c++. The string manipulations are relatively, accessing the data in a timely fashion isn't. What I am doing currently
string str;
ifstream fh("testlog.log",ios::in);
while (getline(fh,str));
From here I get the useful data from the string. This works fine for a log file with 100 entries, but takes forever on a log file with million+ entries. Any help would greatly be appreciated
fgets
? Open the file withfopen
and then something likewhile(fgets(cstr, 256, fp))
. Tell us what your results are (how long it takes).