fork download
  1. #include <iostream>
  2.  
  3. int main()
  4. {
  5. std::cout << " Hi today we will be dynamically allocating an array.\n"
  6. " How large would you like the array to be?\n";
  7. int userArraySize; //What the user wants the array size to be
  8. std::cin >> userArraySize;
  9. int* numbers = new int[userArraySize];
  10. }
  11.  
Success #stdin #stdout 0s 3276KB
stdin
6
stdout
 Hi today we will be dynamically allocating an array.
 How large would you like the array to be?