#include <stdio.h>

// Return type of the function should be int* to return a pointer
int* create_array(int size, int arr[]) {
    for (int i = 0; i < size; i++) {
        arr[i] = i;
    }
    return arr; // We are returning the address of the first element of the array, not an entire array
}

int main() {
    int size = 5;
    int arr[size];
    int *ptr = create_array(size, arr);

    for (int i = 0; i < size; i++) {
        printf("%d ", arr[i]);
    }
    printf("\n");

    printf("Pointer points to the 0th element: %d\n", *ptr);
    ptr+=3; // Move the pointer to the 3rd element
    printf("Pointer now points to the 3rd element: %d\n", *ptr);


    return 0;
}