I have my function and I am filling targetBubble there, but it is not filled after calling this function, but I know it was filled in this function because I ha
targetBubble
Because you are passing a copy of pointer. To change the pointer you need something like this:
void foo(int **ptr) //pointer to pointer { *ptr = new int[10]; //just for example, use RAII in a real world }
or
void bar(int *& ptr) //reference to pointer (a bit confusing look) { ptr = new int[10]; }