I've been recently reading the forums a lot, seeing people throw around the phrase "pass-by-reference" in normal C. As far as I've been taught, C only provides pass-by-value. Now.....the developers of C came up with this genious idea of passing an address (which is still a value) through the parameters of a method (&variable) in order to SIMULATE pass-by-reference.
As far as I'm concerned, I dont care who says this IS pass-by-reference, I disagree. Just because a certain variable's value happens to be an address does not (in most C books i've referenced :cheesy: ) constitute pass-by-reference. I consider (not alone on this) a language to provide pass-by-reference if and only if the code specifically states it's passing a reference to the variable into the method (ref in C# and other languages). I myself, find this statement to be self evident.
I know this may stir a debate. Others may have a different view, but I am sort of tired of hearing that arrays are passed by reference when the address of the array (hense it's value) is passed in the C language. I'd be interested to hear a rebuttle.
EDIT: On a similar note, Java is also pass by value only. An objects value is an address in Dynamic Storage, and this address is passed into methods, not an actual reference to that variable.
Tyler S. Breton