"Eliah NInyo" <[EMAIL PROTECTED]> writes:

> i know that "*" sign is to define a pointer and "&" sign if for address.
> what what the combination mean???

Yes, * defines a pointer. The &, in a C++ function declaration, means
pass by reference. So,

 func(int*&foo) {
   foo = new int;
 }

means a function that accepts pointer to int using pass by reference
semantics. 

If you do

  int* myptr;
  func(myptr);

myptr will be changed after func exits. In C, you would do

  func(int** foo) {
    *foo = malloc(sizeof(int));
  }

  int* myptr
  func(&myptr);

You should get a good c++ book, which explains this syntax in more detail.

-- 
Dave Carrigan ([EMAIL PROTECTED])            | Yow! I HAVE to buy a new ``DODGE
UNIX-Apache-Perl-Linux-Firewalls-LDAP-C-DNS | MISER'' and two dozen JORDACHE
Seattle, WA, USA                            | JEANS because my viewscreen is
http://www.rudedog.org/                     | ``USER-FRIENDLY''!!

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to