In my main I have:
Volume* myVolume = new Volume();
Geometry* myGeometry = new Geometry();
DataHandler* myData = new DataHandler();
and after the volume and geometry data is put into maps I call:
myData->SortAllData();
which is causing a seg fault at:
std::map<int,std::vector<std::string> > geomData = geometry->GetAllData();
where I declared:
Geometry* geometry;
to access the function in my geometry file:
std::map<int,std::vector<std::string> > GetAllData() { return all_the_geometries ;};
When I do the function call in my main program it works no problem but when I do the function call in my data_handler file I get a seg fault.
I believe all the pointers are defined properly and I included all the files. Any idea what I am missing?
Volume* myVolume = new Volume();
sigh, ¿Is there a good reason to do that instead of Volume myVolume;
?
Your presentation is confusing. ¿Could you post the calls in main and data_handler? (with a little context, please)