| ??? 01/02/04 13:17 Read: times |
#61733 - RE: OT: C parameter by reference or by value Responding to: ???'s previous message |
Well, in case of long intergers or float numbers its best to pass the paramter by reference. But most of the times its just a byte of date to pass, can do with passing by value.
Another aspect of C is all parameters are passed on stack, as far as possible see if your compiler supports register paramter passing, it will save you some stack as well as some cycles. Bottomline: it depends on the situation, and the type of data to be passed. gary P.S. Some newer MCS-51 variants support more than 256 bytes of internal memory, address wont be 1 byte in this case, so if the parameter is 8 bit, do it by value. gary |



