Does it possible to pass a 2 dimensional array to a funciton? does it accepts?
"why not?"
Because I don't want to get drawn into a prolonged discussion on something that has no real value to me.
I normally refer to the reference manuals and standards when I:
1 - Have time 2 - Need to learn something new 3 - Need clarification on something
(not an exhaustive list)
Whoops - Looks like I'm getting sucked in!
Bye.
seems applicable...
;-)
"Looks like I'm getting sucked in!"
Bwa Ha Haaaaaaaaaaaaaa!
You cannot resist - it is your Destiny...
C++ has pass-by-reference. Pascal has pass-by-reference.
C only has pass-by-value.
Note that pointers are also passed by value.
But the particular value that is passed for an array is the address of the array - not the content of the array!
So arrays are effectively passed by "reference"...
"So arrays are effectively passed by "reference"..."
Yes, that could be considered a valid interpretation.
Typically when a structure is passed by value, the compiler allocates space for a copy of that structure (for example, 80x86 would 'borrow' space from the stack), copy the structure across and then pass a pointer to that newly allocated space.
So, on an 8051, this would obviously be quite a cycle intensive operation. As I said before "... something to be treated with caution ...".
Oh shucks, I'm being dragged in again (sob-sob).