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;
There is no way to do what you say in C++ with plain arrays. The C++ solution for that is by using the STL library that gives you the std::vector.
You can use a vector in this way:
vector
std::vector< int > arr; arr.push_back(1); arr.push_back(2); arr.push_back(3);