[Solved] How to fix Segmentation Fault error when instantiating objects
[ad_1] We don’t have the full details on your string class, so this is hard to reproduce. However, when you call sensors[0] = sensor1; you are copying your Sensor, but haven’t defined an assignment operator (or copy constructor for that matter). You also do this in the Car constructor with (*(m_sensors + i)) = Sensor(*(sensors … Read more