I've got a program that has three different classes, all of which have their own pointer to an class called ObsFileName, who's main functionality is to store the name of an output file individual to the class, and return it with a function value(). All throughout the program, when a certain type of event is triggered, the class it coincides with outputs to the ofstream, like this:
std::ofstream observationData;
observationData.open (ObsFileName->value().c_str(), std::ios::app);
observationData << "8,";
observationData.close();
So, in my program, I've got three classes. Component1, Component2, and Component3, and their output files contain:
Component1-obs.txt: 1,3,1,3,1,4,1,4,1,4,1,4,1.....
Component2-obs.txt: ⰷⰷⰵⰷⰵⰷⰵⰷⰵⰷⰵⰷⰷⰷⰷⰷⰷⰷⰵⰷⰷⰵⰷ....
Component3-obs.txt: 8,8,9,12,8,8,9,12,9,12....
Any idea why Component2 keeps outputting the wackyness? (Yes that's a technical term.) It's initialized, etc., in all the same ways as Component1 and Component3.
Any help would be greatly appreciated.