Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

Pointer to Pointer The double asterisks need or not needed?

$
0
0
So my question pretains to pointers to a pointer. I've been working with passing array data structures and other data structures to my functions. This reminded me of something I read a while back in one of my first C++ tutorials.

Anyways, is it honestly necessary to declare a pointer thats meant to point to another pointer with the double asterisks?

int **pointer


Also is what if, lets say we are passing different variables to a function whose function parameters contains a pointer.

void functionExample(int *ptr){~}

int main(){

int a, b;
int *c;

functionExample(&a);
functionExample(&c);  //Pointer to Pointer



So would this cause problems? Since its a pointer to pointer with the receiving pointer being declared with only 1 asterisks.

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>