They are both filestreams.
fstream objects opens a file in user-specified mode, it could be to read from, write to, and(or)in binary mode.
ofstream objects opens a file only for output mode.
That depends on what arguments you supply to std::getline()
std::getline() does not take TWO std::fstream or std::istream object but rather an std::istream or std::ifstream object with another data type(int, const char *, std::string etc). I guess you supplied it two wrong arguments.