What is ** in C++?

** is not actually only pointer to pointer (as in declaration), but is also the dereference of a dereference (in a statement).

It is used often in C which does not have the & notation for references, e.g. to update a return value which is a pointer type:

int alloc_foo(struct foo **foo_ret)
{
    *foo_ret = malloc(sizeof(struct foo));
    return 1; /* to indicate success; return value in foo_ret */
}

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)