I am trying to read a line from the config file in C++.

the line i am trying to read looks something like this:
cfg.?.readline=("string1,string2");

there are a 1000 lines in the file that begin with cfg but only 1 that
has "readline" in it. also i dont know wat variable1 and variable2 are
(there could be more than 2 strings. i am not supposed to know the
count either). i have to read them in and print them out.

the other thing is the config file is located in another dir.

Can you please tell me how i can extract the line from the config
file. i was thinking of using fgets... but was not sure if C++ had a
better way of doing this?
n also how exactly does getline work?

After i get the line it should be ok, i could use delimiters and count
the number of strings and assign variables to them to print them out.

Thank you.

 

Reply via email to