Object-Oriented Programming C++ – I have to output my program toa file called “sim.txt”. My simulation is a function obviously soI’m not able to do a thing like:
std::ofstream outputFile;
outputFile.open(“sim.txt”, std::ios::out);
outputFile << runSimulation(franchises,days);
outputFile.close();
Because I then get the error that is that the operator <<does not recognize an ofstream to a void function.runSimulation also has anotherprint function nested within it calledprintRundown that runSimulationcalls once per day.
Signatures for printRundown andrunSimulation:
void runSimulation(std::vector<HotdogStand>&franchises, int days);
void printRundown(conststd::vector<MyAwesomeBusiness::HotdogStand>&franchises);
I’d prefer you to overload the operator << to make ithappen, but if there is a way that you know of that is easier thenplease do go with that. I’m
PayPal Gateway not configured
PayPal Gateway not configured