S
spinoza1111
Richard Heathfield said:Phil Carmody said:Only by torturing the concept of pass by reference beyond its yield
point.
Not in my opinion.
If passing the address of a variable were equivalent to
passing by reference, then the following program would print 42:
Strong assertion.
#include <stdio.h>void byref(int *p)
{
p = 42; /* bug - p was *not* passed by reference. */
}
And completely unfounded. There's no definition of 'pass by reference'
which would justify your claim. You've just burnt a straw man.
[Snip things dependenent upon straw man.]
He has a point (a small point, but nonetheless a point). In VB,
declaring a variable as passed by ref in the formal parameter list
doesn't give the sub or function the ability to get the address of the
variable, whereas C does, bless its black heart. In C Sharp, you must
declare the parameter as passed by reference in both the formal and
actual parameter lists (the requirement to do so in the actual
parameter list is a virtuous error checker upper onner). But you don't
get the von Neumann address because you don't need it and you will
foul things up with it were you to get it.
Therefore, to make Richard happy, we should call C's very special
variant of By Reference, which gives you the functionality of VB ByRef
and C Sharp ref PLUS the chance to make a mess of things, something
like "by reference with the chance to **** up", BRWTCTFU.