I want to add an int into an array, but the problem is that I don\'t know what the index is now.
int[] arr = new int[15]; arr[0] = 1; arr[1] = 2; arr[2] = 3;
Since I got so many negative feedback I realized my solution was wrong so i changed it.
int arr[20] = {1,2,3,4,5}; int index = 5; void push(int n){ arr[index] = n; index++; } push(6)
New array will contain value from 1 to 6 and you can make function for deletion like this as well.