+ 3
How to send an array to a function whose number of rows and columns is unknown? in c language
How to send an array to a function whose number of rows and columns is unknown? in c language
2 Respuestas
+ 1
You can use pointers to do this task
As arrays are allocated continuously in memory so all you have to pass to the function is the address of first element of array and just increment or decrement the pointer to acess others
OR
/*you can also use sizeof() function to find out it's size and then pass it to function*/
EDIT:- I guess Martin Taylor is right, sizeof function returns the size of pointer not the array, thanks for informing me🙂🙃👍