This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Pass 2 dimensional array in function

Does it possible to pass a 2 dimensional array to a funciton? does it accepts?

Parents
  • "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).

Reply
  • "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).

Children
No data