I'm with a situation similar to this:
#include <stdio.h>
#include <stdlib.h>
void madeVector(int **occurr){
int vector[] = { 1, 2, 3, 4, 5};
int *pOccurr;
pOccurr = vector;
occurr = &pOccurr;
printf("\n--==[Inside Function]==--\n\n");
for(int i = 0; i < 5; i++){
printf(" %i", *(*occurr + i));
}
printf("\n\n");
}
int main()
{
int **pp;
madeVector(pp);
printf("\n--==[Outside Function]==--\n\n");
for(int i = 0; i < 5; i++){
printf(" %i", *(pp + i));
}
printf("\n\n");
return 0;
}
I need to print all number in vector inside function "madeVector" and "main" using double pointer variables, how showed in code. But, it works only inside function "madeVector". I don't know how to print in "main" function. I tryed everthing, but it doesn't work.
Would someone help me to solve this problem?
Thanks in advance!