You should check that the file actually opened.
read.open(filename_user.c_str(), ios::in);
if( ! read )
{
//error handler here
}
else
while(getline(read, linecount, '\n'))
{
++lc;
}
Are you sure the data file is in the place where your program is looking for it?