C programming/2

In C programming, creating an array for use inside a function works just like creating an array for use inside the main() function: The array is declared, it’s initialized, and its elements are used. You can also pass arrays to and from functions, where the array’s elements can be accessed or manipulated.

int add(int arr[]);

int main(void)
    int array[2];
    int ans;
    ans = 0;

    printf("data input。\n");
    scanf_s("%d", &array[0]);
    scanf_s("%d %d", &array[0],&array[1]);
     ans = add(array);

    printf("%d", ans);

int add(int arr[]) {
    return x[0] + x[1];