Does it possible to pass a 2 dimensional array to a funciton? does it accepts?
Yes.
Standard 'C' stuff - nothing specifically to do with Keil or embedded systems.
Hint: think about pointers...
Can it be past by value
No.
Again, this is standard 'C' stuff - nothing specifically to do with Keil C51.
So, go back to your 'C' textbook and review how 'C' handles arrays - of all dimensions!
http://www.keil.com/books/genbooks.asp http://c-faq.com/
I'm not going to go trawling through the reference books on this (I'll leave that to others who aren't so busy, or have to for an assignment), but I think you can pass an array by value. Even multi-dimensional ones.
If you cannot do it directly, then you can enclose it in a structure and pass the structure by value.
As to why??? Maybe someone can see a reason, but it sure sounds like something to be treated with caution to me.
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...!!
View all questions in Keil forum