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
  • No, you can't.

    "If you cannot do it directly..."

    Which you can't

    "...then you can enclose it in a structure and pass the structure by value."

    Yes, you could do that.

    "As to why??? Maybe someone can see a reason"

    The usual "good programming practice" (sic?) reason for which you'd pass any parameter by value if you didn't specifically want the function fiddling with the "original" item.

    The reason for not doing it, of course, is the cost of copying (potentially) very large amounts of data - especially for an 8051...!!

Reply
  • No, you can't.

    "If you cannot do it directly..."

    Which you can't

    "...then you can enclose it in a structure and pass the structure by value."

    Yes, you could do that.

    "As to why??? Maybe someone can see a reason"

    The usual "good programming practice" (sic?) reason for which you'd pass any parameter by value if you didn't specifically want the function fiddling with the "original" item.

    The reason for not doing it, of course, is the cost of copying (potentially) very large amounts of data - especially for an 8051...!!

Children
No data