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;
Use a vector:
#include void foo() { std::vector v; v.push_back( 1 ); // equivalent to v[0] = 1 }