User Profile

Collapse

Profile Sidebar

Collapse
sg14
sg14
Last Activity: Nov 21 '07, 07:22 PM
Joined: Nov 13 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • sg14
    replied to Help finding a string in a file
    in C
    It's for a homework assignment, so I don't know anything about iterators or anything, just basic c++ stuff. :-(
    See more | Go to post

    Leave a comment:


  • sg14
    replied to Help finding a string in a file
    in C
    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,...
    See more | Go to post

    Leave a comment:


  • sg14
    started a topic Help finding a string in a file
    in C

    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?
    See more | Go to post
No activity results to display
Show More
Working...