How do I set array to a new array? : I need to a implement a function that modifies array. New array maybe different size. `cout` prints 1. I understand what's wrong with this code but I just cannot figure out what the syntax is. 


    //tried this..
        int reduce(int *array[])
        {
          *array = new int[1];
          (*array)[0] = 6;
         return 0;
        }
    

    //also tried this..
        int reduce(int array[])
        {
          array = new int [1];
          array[0] = 6;
         return 0;
        }
    
        
        
        int main()
        {
            int a[1] = {1};
            int *p = a;
            
            reduce(&p);
            cout << a[0];
            
            return 0;
        }

