Re: pointers and array of pointers



Klarth wrote:

I often think of pointers as a VARIABLE that contains a reference
to an address. So when you are calling myswap, you are passing in
copies of the references. Want you want to do in myswap is pass the
pointers by reference so you can change it. You do this by passing
in type char ** and passing the address of the pointers instead. In
myswap2, you are already effectively passing by reference, which is
why the swap is reflected when it returns.

What, if anything, does this mean? See below.

--
If you want to post a followup via groups.google.com, ensure
you quote enough for the article to make sense. Google is only
an interface to Usenet; it's not Usenet itself. Don't assume
your readers can, or ever will, see any previous articles.
More details at: <http://cfaj.freeshell.org/google/>



--
Posted via a free Usenet account from http://www.teranews.com

.



Relevant Pages

  • Re: pointer syntax
    ... > really passing a reference (which is like an old-school pointer, ... > a copy of the primitive's value and passing that. ... build them yourself with pointers. ... mean a var parameter, write a var parameter. ...
    (comp.lang.pascal.delphi.misc)
  • Re: programming concepts > specific languages
    ... > pointers if you are just doing java all along. ... Java has consistent, but non-intuitive, rules involving passing by ... value/passing by reference. ... A lot of beginning Java programmers don't ...
    (comp.programming)
  • Re: no pointer in Java => my problem
    ... >> the value you are passing is an adress and you can't change the ... When passing a reference, you don't get ... > code anyway, where there are no pointers or references, just bit ... can design applications using objects and still implement them in C. ...
    (comp.lang.java.programmer)
  • Re: pointers and array of pointers
    ... I often think of pointers as a VARIABLE that contains a reference to ... So when you are calling myswap, you are passing in copies ...
    (comp.lang.c)
  • Re: dont understand looping problem
    ... > passing pointers is still pass by value. ... by reference" -- that is, you pass an object by reference by passing a ... My goal in these books is not to clutter them up with overly precise ...
    (alt.comp.lang.learn.c-cpp)