Question: 1 . Each byte in memory is assigned a unique address. 2 . The ampersand operator can be used to determine a variable's address. 3

1. Each byte in memory is assigned a unique address.
2. The ampersand operator can be used to determine a variable's address.
3. pointer variables are designed to hold addresses.
4. The indirection operator can be used to work with the variable a pointer points to.
5. Array names can be used as __________ and vice-versa.
6. Creating variables while a program is running is called __________.
7. The __________ operator is used to dynamically allocate memory.
8. If the new operator cannot allocate the amount of memory requested, it throws __________.
9. A pointer that is explicitly set to the address 0, indicating that it does not point to any valid memory location, is called a __________ pointer. What is the significance of using such a pointer in C++?
10. When a program is finished with a chunk of dynamically allocated memory, it should free it with the __________ operator.
11. You should only use the delete operator to deallocate memory that was dynamically acquired with the __________ operator.
12. What does the indirection operator do?
13. Look at the following code.
```cpp
int x =7;
int* ptr = &x;
```
What will be displayed if you send the expression `*ptr` to `cout`? What happens if you send the expression `ptr` to `cout`?
14. Name two different uses for the C++ operator `*`.
15. Which arithmetic operations can be applied to pointers?
16. Assuming that `ptr` is a pointer to an `int`, what happens when you add 4 to it?
17. Look at the following array definition.
```cpp
int numbers[]={2,4,6,8,10};
```
What will the following statement display?
```cpp
cout <<*(numbers +3)<< endl;
```

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!