Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // get number from user.
- cout << "Enter a number: ";
- cin >> num;
- // init dynamic array w/ n numbers.
- int *ptr = new int[num]
- for (int i = 0; i < num; i++)
- cout << "num " << (i + 1) << ": ";
- cin >> ptr[i];
- delete [] ptr;
- ptr = 0;
Add Comment
Please, Sign In to add comment