Restructuring Array Of Objects In Cpp