I came across some strange declarations and am trying to get the hang of it. Any comments on how to read and use such decl. will be most welcomed.
1) Not sure if i understand this one. It could be that function f can be used to increment the address of a pointer. So to use f(...) give it an argument of type: int*
2) I got this one from pg35 of "C++ in a nutshell," i've put arrows to indicate where i got confused:
How do i read those in plain english and if i had a function f(int*&* p), or something more complicated, how do i know what type of argument it needs? thanks.
1) Not sure if i understand this one. It could be that function f can be used to increment the address of a pointer. So to use f(...) give it an argument of type: int*
Code:
void f(int*& i) { i++; }
Code:
int x; //some int int& r = &x; //ref to int int* p = &x; //pointer to int int*&* rp = &r; //error: no pointer to ref <---? int*&* pr = p; //ok: ref to pointer <--- ?
Comment