User Profile
Collapse
-
It's for a homework assignment, so I don't know anything about iterators or anything, just basic c++ stuff. :-( -
Well, I changed my algorithm. I'm now searching for "mailto:". This is what I have (it doesn't work).
string sub;
int found_position = 0;
//string s = " ";
char temp_s[200];
string found_email = " ";
char temp_sub[50];
while (! instream.eof() )
{
instream.getlin e(temp_s,...Leave a comment:
-
Help finding a string in a file
I'm having a little trouble finding multiple occurrences of a string in a file. I have a txt file and I have to find e-mail addresses out of it. I open the file with ifstream, and use getline to read in each line. I then use str.find(str1, pos) to find the '@' symbol in the file. I just can't figure out how to pull the entire address out and not just the @ symbol. Any tips?
No activity results to display
Show More
Leave a comment: