Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   extracting a substring after identifying a marker (http://www.go4expert.com/forums/extracting-substring-identifying-marker-t20253/)

Zdog 2Dec2009 04:03

extracting a substring after identifying a marker
 
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,

Gene Poole 2Dec2009 09:06

Re: extracting a substring after identifying a marker
 
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.).


All times are GMT +5.5. The time now is 01:15.