how to take input from the user on the number of elements in an array

really need to know
1
2
3
4
5
6
int main(){
   int n;
   //allusive message
   std::cin >> n;
   std::vector<foo> v(n); //creating an "array" of n elements
}
Topic archived. No new replies allowed.