Hello, i'm new to daniweb and also quite new to C++. I'm trying to write a function that takes a filename and a string query like
string GetStringValue(string filename, string query)
{
/*...*/
}
then finds the query in the file, and returns what's behind the = mark.
the file's entries are like this:
ProgramTitle="This is the program's Title"
MyName="Katmai539"
so when i call the function like
string asimplestring=(GetStringValue("file.txt", "ProgramTitle"));
it has to return "This is the program's Title" as a string.
Searching the webs left me reading about putting the whole textfile in buffers and then buffer.find(query) them, but it made me a bit unsure about doing this.
Do i really need to put the whole file in a buffer just to find a string in it?
Many, many thanks,
Katmaï