|
-
April 10th, 2012, 11:45 AM
#2
Re: passing a multi-dimensional array to a function
 Originally Posted by aryan1
After passing the address of the first element (&array[0][0]) of a multi-dimensional integer array to a function with a "const int*" parameter, parameter seems to be pointing to the wrong values, which are not the actual elements of the passed array.
I might be missing something obvious myself, but that sounds like it should work: you are just interpreting a 2D array as one big 1D array, which is fine. How do you know that it does not work? Posting a small example program might help.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|