problem in initializing an array
I tried to initialize an array in the constructor of my class. here is how it looks.
MyClass::MyClass(double**arr, int N,int d)
arr[i]=new double [secd];
but when I try to use it in main function like below code:
It gives a run time error and says that myarr is not initialized
and I can't understand the problem, what is wrong ??
Last edited on
I think its because **myarr does not hold a value. You need to set it to something (maybe). I am a noob to pointers but that is usually what that error means.
but I did set it to zero in the consructor
Topic archived. No new replies allowed.