Code:
FileName = FindStudent += ".txt";
ofstream StudentName( FileName.c_str() );
that should be what your looking for, I just learned this same stuff yesterday. That will search for that filename in the same directory as where the program is being run from. I'm currently trying to figure out how to have it search in other "child" folders of the folder the program is running from.
***EDIT: that is if your opening the file to write to it, use:
Code:
ifstream StudentName( FileName.c_str() );
//In place of:
ofstream StudentName( FileName.c_str() );
//If you want to read from the file