hello there, i think the problem is on line 25.
you're creating a new variable called "matrix" overshadowing your class variable "SaddleObject.matrix" try changing your constructor code to this
The question says that the 2d matrix is to be allocated space dynamically. The exact words are : A parameterised constructor which takes the size n (as parameter), allocates dynamic space for the array, and puts values in it from the keyboard. It also initializes the data members (b) and (c) above to a value -1, indicating that the saddle has not yet been determined.
n is size of square matrix. At the present I have fixed it to 3.
@Yolanda, you are right, the problem is of "matrix" overshadowing class variable. But I need to allocate memory dynamically for the array. What shall I do?
advice - now that you have decided to use dynamic memory, you also
have to handle it's de-allocation to avoid memory leak, you should
have a deconstructor ~Saddle() defined