This is what I currently have:
#include <iostream>
#include <fstream>
#include <string>
using namespace std;
int main(){
fstream bookings("Schedule.txt");
fstream magicians("Magicians.txt");
fstream holidays("Holidays.txt");
//already tested to make sure these are open & they are
string test;
string holiday;
bookings >> test;
if(test.length()==0){
while(getline(holidays, holiday)){
bookings << holiday;
cout << "test";
}
}
bookings.close();
magicians.close();
holidays.close();
return 0;
}
My Holidays.txt
contains this:
Veteran's Day
Valentine's Day
Halloween
Christmas
New Years
I've made sure my files are in the right directory and that the files are actually open. I stepped through the program to make sure holiday
is getting the line accordingly but bookings << holiday;
just doesn't seem to work properly for me?