Well, I came across this, and I do not know what to think, I know that to allocate memory the operator new
is necessary, however I do not understand why this code works ?, and in any case, what are the possible failures? (Maybe it's a new C ++ 11 feature that I do not know?)
cout << "introduzca la capacidad ";
cin >> capacidad;
// como es esto posible?
double array[capacidad];
for (int i = 0; i < capacidad; i++){
cout << "Numero " << i+1 << ": ";
cin >> array[i];
}
for (int i = 0; i < capacidad; i++)
cout << "Numero " << i+1 << ": " << array[i] << "\n";
Thanks