I want to make class library, a function which its parameter is a matrix of unknown size, and the user will create his own matrix with his own size and pass it to this funct
use this method
declare an array of pointers
ex: int *a[n];
Then allocate memory for them using a for loop
ex:
for( int i=0 ; i
Now pass the argument like normal array. ex: print_array(a,n); And print_array function looks like
print_array(int **a,int n)//the prototype for the print_array
{
//access the array using index such as
std:: cout<
The above case is for the array of nxn incase mxn is required then allocate the memory like
for( int i=0 ; i
then pass the both m,n and to the function and access the array in the for loop.