I am attempting to make a program where people put in their preferences file what they would want to do for that week. I made a huge if else statement and need help with my else statement. My else statement is fair to the users/members as their list is randomly picked and the file is created. However, the else statement creates the file, but does not write any of the roles to it. Here is the code :
else {
string positions[23] =
{ "Day_Clean" "Dinner_Cook" "Dinner_Cook" "Dinner_Clean" "Dinner_Clean" "HEB_Shop" "Costco_Shop" "Silver_Fridge" "Stove_Micowave" "Appliance_Clean" "LH_Bathrooms" "Laundry_Room" "Upstairs_Commons" "Bikeroom_Entrance_Stairs" "Little_House_Commons" "Porch_Grounds" "Recycling" "Gardening" "Condi_Fridge_Personal_Fridge" "Freezer" "Downstairs_Bathroom_1" "Downstairs_Bathroom_2" "Upstairs_Bathroom" "Big_House_Hallways" };
ofstream randomPrefs;
randomPrefs.open(foo);
int randomPrefloopcount;
do {
int randomPrefs1 = rand() % 25;
randomPrefs << positions[randomPrefs1] << "\n";
randomPrefloopcount++;
} while(randomPrefloopcount <= 24);
randomPrefs.close();
The files are created, but they are all blank. Please help!