Ah. That makes much more sense ;P
With that in mind, don't you think it would be easier to search for "<img" and "<a" instead of just a period? I mean, because a period can be in any part of the document.
First you have to determine the maximum length of a line, or if you don't want to, use a string object to dynamically read from the file so length doesn't matter. Here's a start using the former:
Code:
char szBuf[MAX_LEN+1];
while (fin.good()) {
fin.getline(szBuf,MAX_LEN);
if (strstr(szBuf,"<a")) {
//find "href=\"" then the enclosing "\""
}
else if (strstr(szBuf,"<img")) {
//find "src=\"" then it's enclosing "\""
}
else
continue;
//fout << the filename here
}
Just a start to help u in the right direction. I'd write more, but don't have time now.
Hope it helps some.