yeah that's correct, thankyou

I've done this before. do you want it to take a specific line or just have it return the first and only?

This is the first version of my function. i have another that can return the line only if it starts with a specific substring

[CODE]
string getfile(string file, int line)

{
int j = 1;
string retdata;
string notfound = "line not found";

ifstream data( file.c_str() , ios::in);

while ( ! data.eof())
{
getline(data,retdata);
if (j == line )
{
data.close();
return retdata;
}
j++;
}
data.close();
return notfound;
}
[/CODE]

or are you looking for a bool that just returns true if it is there?

commented: This was the right was I have to make a change to my file.open() line but this helped me solve it. +1

I use a mixture of both, if you stick a "\n" in a file it will put the next bit of data on a newline. I think endl is just for console output. its probably good to get used to using "\n" as there are other escape sequences too, like \t (tab) \b (backspace) \" (double quotes) ect. :)