Chapter 9: Problem 29
Write the definition of ptr, a pointer to a constant int.
Chapter 9: Problem 29
Write the definition of ptr, a pointer to a constant int.
All the tools & learning materials you need for study success - in one app.
Get started for freeLook at the following array definition. int set[10]; Write a statement using pointer notation that stores the value 99 in set[7];
Write the definition of ptr, a constant pointer to an int.
Write code that dynamically allocates an array of 20 integers, then uses a loop to allow the user to enter values for each element of the array.
Look at the following function definition. void getNumber(int &n) { cout << "Enter a number: "; cin >> n; } In this function, the parameter n is a reference variable. Rewrite the function so that n is a pointer.
What is the purpose of the new operator?
What do you think about this solution?
We value your feedback to improve our textbook solutions.