Dynamic memory allocation quizes
We declare the following variable
int arr[5];
What is the size in memory of the variable arr
?
- 8 bytes
- 20 bytes
- 32 bytes
- 5 bytes
- 4 bytes
- 10 bytes
The process of getting the value that is stored in the memory location pointed to by a pointer is called:
- Dereferencing
- Pointing
- Accessing
- Casting
What is the value of n
after the following code is executed?
int n = 98;
int *p = &n;
- 99
- 0
- 98
- 402
What happens when one tries to access an illegal memory location?
- The computer shuts down
- The operation is ignored
- Segmentation fault
- There’s a chance for the computer to catch fire, and sometimes even explode