1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

extracting a substring after identifying a marker

Discussion in 'C' started by Zdog, Dec 1, 2009.

  1. Zdog

    Zdog New Member

    Joined:
    Dec 1, 2009
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Hi, I'm really new to C:
    just want to be able to read a string from a file, and then search for a particular word, and having found that word, extract the next string that is delimited by spaces

    ie:

    kjsdiojfir word stringtoextract aohoidhhr

    thanks,
     
  2. Gene Poole

    Gene Poole New Member

    Joined:
    Nov 10, 2009
    Messages:
    93
    Likes Received:
    5
    Trophy Points:
    0
    C or C++?

    In C, there stdio.h functions like: FILE, fopen() fgets(), etc.

    In C++, it's easier with streams like: std::ifstream (read(), getline(), operator>>, etc.).
     

Share This Page