class Pair {
public:
int *pa,*pb;
Pair(int a, int b)
{
pa = new int(a);
pb = new int(b);
}
Pair(const Pair& other) {
int* pc = new int(*other.pa);
int* pd = new int(*other.pb);
}
~Pair() {
delete pa;
delete pb;
}
};
In this program the compiler is producing a Segmentation fault(core dump) and after removing the destructor completely can we get the program to run without any errors so can anyone pls help me with this? Also even tho in the parameterized constructor I initialized the pointers the compiler gives warning that the point pa and pb are not initialized.