#include #include using namespace std; int main() { cout << "How many ints do you want to store? "; size_t n {0}; cin >> n; int *const p {new int[n]}; //p will always point to the same place. //p can read and write the ints //This q can read and write. for (int *q {p}; q < p+n; ++q) { cout << "Please input int number " << q-p << ": "; cin >> *q; } cout << "Here are the ints that you input:\n"; //This q can read but not write. for (const int *q {p}; q < p+n; ++q) { cout << q-p << ": " << *q << "\n"; } delete[] p; return EXIT_SUCCESS; }