Hey Im getting an error I think has to do with copying ofstream variable from reading other posts and Ive tried to change
std::ofstream outfil;
References must be initialized when they are created. There doesn't seem to be a use for references there anyway.