There are multiple things wrong with this code.
int size;
char arr[size];
You are declaring a char array arr with size elements, but size is not yet initialized yet and may be any value. Also note that "deciding the size of an array at runtime" is only valid in modern C (C99 onwards).
You should first read size and only after the scanf declare arr.
for (int i = 0; i < size; i++){
scanf("%s", &arr[i]);
}
You read a string (%s) with scanf and try to store it in a char (&arr[i] points to the ith char in arr). Every C string is atleast 1 character long (the terminating \0 character), you are trying to store multiple characters in a single char.
Instead use
scanf("%s", arr);
Note that scanf is not safe. Even if you enter more than size characters, it will still try to store them in arr. That leads to undefined behaviour, because arr is too small. Instead you can use fgets, that lets you set the number of characters to read.
for (int i = 0; i < size; i++){
printf("%s\n", arr[i]);
}
Here you are trying to print a String (%s), but you are passing a char (arr[i] is the ith char in arr).
Instead use
printf("%s\n", arr);
char arr[size];is a 1d array that can hold a single c-string. Also,sizeis uninitialized at that point so even when you changesizelater, the array is already created.sizefrom the user, then declare:char arr[size][100];. Also, you can change toscanf("%s", arr[i]);...*You can change100to the max string length you expect.sizeyou can overwrite the stack. Dynamic memory allocation (malloc) might be better here. Is it required that a C Variable Length Array is allocated from the stack?