#include <iostream>
#include <string>
#include <fstream>
using namespace std;

void mygetline(ifstream& file){
string s;
getline(file, s);
cout << s << endl;
}

main()
{
ifstream file("hogehoge.txt");
mygetline(file);
}

です。