I am trying to create an abstract data type for a Matrix in C. The struct declaration I have for the abstract matrix data type is the following:
typedef struct matrix_st *Matrix;
And I want to create a new instance of these 3 methods where createMatrix creates the matrix ,checkequals checks to see if 2 given matrixs are equal and checkDuplicate checks to see that they are the same :
Matrix Creatematrix( size_t rows, size_t cols );
bool checkequals( const Matrix m1, const Matrix m2 );
Matrix checkDuplicate( const Matrix mat );
How would I structure my struct to be able to follow this format? Would just go ahead and set up a 2d array within the struct? Any help would be appreciated. I am mainly just confused on how to set the matrix as a abstract data type and how I would start implementing it.