| ??? 01/04/04 12:45 Read: times |
#61882 - RE: Pointer vs Reference Responding to: ???'s previous message |
There is not necessarily any need for a separate pointer - just use the 'address-of' operator in the actual parameter of the function call. agreed, a pointer need not consume space, but I was talking about the space it uses on the user stack, or the register via which it is refered to. no problems with that space either, the point was if there is a variable and if it could be passed by value, do it. for larger variables however, either use a pointer, which is useful if the function intends to return the result (effectively modify the variable contents) but then you can even have two registers to pass 16 bit data. and if it is a global variable, then you dont even need to pass anything, the function can implicitely assume the address of the variable and work on them. that will save some linkage code and a few cycles. girish |



