I've written this C code in which the `int* arrayInit();` assigns values to a globally declared array of 3 elements and returns the address of the first element of the array.In Segment 1, the array elements and their respective addresses are printed using the fuction `int* arrayInit()` and the same elements and addresses are printed in Segment 2 using the function `void main()`. Here is the code:

```
#include<stdio.h>

int array[3];   //global declaration of array

int *arrayInit()
   {
    int array[]={1,2,3};
    int* ptr=&array[0];

    /*Segment 1:
      To print the array elements and its address using
      user-defined function*/
    printf("\nSegment 1 : Through User-Defined Function:");
    for(int i=0;i<3;i++)
        printf("\n%d\t%p",array[i],&array[i]);

    return ptr;
   }

void main()
   {
    int *pointer=arrayInit();        //storing address returned by arrayInit()

    /*Segment 2:
      To print the array elements and its address using
      user-defined function*/ 
    printf("\n\nSegment 2 : Through Main Function:");
    for(int i=0;i<3;i++)     //will perform the operation 3 times
         {
          printf("\n%d\t%p",*pointer,pointer);
          pointer++;
         }
   }

```

When I run this code, I get a result somewhat like this:

```
Segment 1 : Through User-Defined Function:
1       0061FEDC
2       0061FEE0
3       0061FEE4

Segment 2 : Through Main Function:
24      0061FEDC
6422220 0061FEE0
3       0061FEE4

```

The strange thing is that the addresses in both Segment 1 and Segment 2 are same but the values in those addresses are different when accessed through different functions. Please explain.

Thank You.