extracting a substring after identifying a marker

Zdog's Avatar, Join Date: Dec 2009
Newbie Member
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


kjsdiojfir word stringtoextract aohoidhhr

Gene Poole's Avatar, Join Date: Nov 2009
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.).