title: Can't get my pointers to send a reference to the array
body: <pre><code>#include&lt;stdio.h&gt;
  #include&lt;stdlib.h&gt;
  
  int* getEvenNumbers(int arr[], int N)
  {
      int i, k = 0 , a[50], p;
      for (i = 0; i &lt; N; i++)
         {
             if (arr[i] % 2 == 0)
              {
                arr[k]=arr[i];
                 k++;
              }
         }
  
        return arr[k];
  }
  
  
  
  int main ()
  {
  int i, arr[5000000], N, a[500000], k, *p;
  
      printf("\nEnter your desired length of the array:\n\n");
      scanf("%d", &amp;N);
  
      for (i = 0; i &lt; N; i++)
          arr[i]=  rand();
  
      getEvenNumbers (arr, N);
  
          printf("\n\nEven numbers in the array are as follows:\n\n");
      for (i = 0; i &lt; N; i++)
          {
          a[i]= *(p+i);
        printf("\n[%d] = %d", (i+1), a[i]);
          }
  }
  </code></pre>
  
  <p>please i know this is probably very easy for you guys but i need help figuring out how to return a pointer to the array without all my values of my array getting deleted, also i can't use global variables and it has to be a function that returns a pointer pointing to the array</p>