In the ol' CCS PICC manual, it claims the following two functions using pointers and arguments passed by reference are equivalent, without any sort of explanation at all: 1. funct_a (int*x, { if(*x != 5) *y = *x + 3; } Call with: funct_a(&a, &b) // this one makes sense: Pass addresses to pointers 2. funct_b(int&x,int&y){ if(x != 5) y = x + 3; } Call with: funct_b(a,b); // this one doesn't make sense to me: Pass a and b to address? Now can someone point me to a pointer pointing out how these subtle points work? (I just had to say that.) I seem to vaguely understand that funt_a(&x, &y) passes the address of x and y to two pointers, then the function operates on the contents of those poitners. The original variables x and y are then changed by funct_a because the arguments are passed by reference. So far so good. The second example, however, stumps me. I would read this like this: Function B takes the address of x and the address of y, then operates on the address (not the contents) of x and y, and doesn't change the original variable. Obviously, since these two functions are supposed to do the same thing, my muddy understanding of this is not very clear. Is this just an example of pointless non-ANSI C CCS behavior, or is there a point in time when all this will become clear? How does the second funct_b accomplish changing the original variables? -- Lawrence Lile Sr. Project Engineer Salton inc. Toastmaster Div. 573-446-5661 Voice 573-446-5676 Fax -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu