C++ Implementing a custom Array class

Good call!

There is one last thing I think I am having trouble with. I made a test case in the main to run like:

void test() {
    myArray a = fibonacci(20);
    cout << "20 Fibonacci numbers:" << endl;
    test(a);
  cout << "Generating Randoms" << endl;
    rand(&a);
  cout << "Testing Randoms" << endl;
    test(a);
  cout << "myArray b,c" << endl;
    myArray b,c;
  cout << "b = c = a" << endl;
    b = c = a;
  cout << "Generating Randoms on A again" << endl;
    rand(&a);
  cout << "Testing on all 3" << endl;
    test(a);
    test(b);
    test(c);
}

It does the Fibonacci and Random numbers well. However, when it reaches "b = c = a", it gets exit status -1.

Does this mean that something is wrong with my overload =? Or is it maybe something wrong with my copy constructor? I am not entirely sure how to fix this problem.

/r/learnprogramming Thread Parent