Dear Friends
Sorry if this is an inane and basic question, it just reflects the ignorance of the writer if it is...
I have created two class files, one for reading Greyscale type pgm files and consists of a dynamically allocated 2 dimensional array. For which the destructor seems to work fine.
My second class file is for reading colour Images and contains 3 greyscale objects (one for each colour channel RGB).
My question is, do i need a separate destructor to remove colour images, or will the grey scale destructor be called automatically?
I currently have a colour image destructor that tries to delete my greyscales (i.e. invoke their destructors) but i am getting a segmentation fault and a core dump.
Once again, sorry if this is a stupid question.
PipK (learner!!)
, the other is a colour image file
Sorry if this is an inane and basic question, it just reflects the ignorance of the writer if it is...
I have created two class files, one for reading Greyscale type pgm files and consists of a dynamically allocated 2 dimensional array. For which the destructor seems to work fine.
My second class file is for reading colour Images and contains 3 greyscale objects (one for each colour channel RGB).
My question is, do i need a separate destructor to remove colour images, or will the grey scale destructor be called automatically?
I currently have a colour image destructor that tries to delete my greyscales (i.e. invoke their destructors) but i am getting a segmentation fault and a core dump.
Once again, sorry if this is a stupid question.
PipK (learner!!)
, the other is a colour image file