File controller c++

Hello,

Is there a way to get a string output based on a file by a given line?
Example, im checking for a file name text. I then give a certain line i wanna check, and what ever there is on that line i get a string