#include <stdio.h>
#include <stdlib.h>
void add(int *arr, int n);
int main() {
  int arr[] = {};
  add(arr, 4);
  return 0;
}
void add(int *arr, int n){
  for (int i = 0; i < n; i++){
    printf("%d index is : ", i);
    scanf("%d\n", &arr[i+1]);
  }
}
the for loop doesn't work after the i == 1... the execution stops and then I have to press some alphabet and executes the whole for loop with no values...
 
    