0

I have come across one question:

find the size of two 2-D arrays when double pointers are given for them.Then find, if we can muliply these two matrices(those mathematics rules). finally we have to multiply the matrices.

I have asked this question(small part of this question) earlier also. someone answered that it is not possible to get the size like this. I aksed for the single-D array. I know same would be applied for the 2D arrays also. but, what might he be expecting from the person who is going to answer this? How can we find the sizes using double pointers passed to one function? Thanks in advance.

P.S This is not a homework. I don't want any code or link. I know how to multiply matrices and maths behind all this. :)

Edited by nitin1

2
Contributors
1
Reply
11
Views
1 Year
Discussion Span
Last Post by Moschops
0

If all you have is a pointer, and it might be pointing to an element of an array, there is NO way to deduce the size of that array. Doesn't matter if it's 2D or 1D. If all you have is a pointer to an element in the array, you cannot tell how big the array is.

Edited by Moschops

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.