Skip to content

Latest commit

 

History

History
47 lines (37 loc) · 952 Bytes

File metadata and controls

47 lines (37 loc) · 952 Bytes

img

Dynamic memory allocation quizes

Question #0

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

Question #1

The process of getting the value that is stored in the memory location pointed to by a pointer is called:

  • Dereferencing
  • Pointing
  • Accessing
  • Casting

Question #2

What is the value of n after the following code is executed?

int n = 98;
int *p = &n;
  • 99
  • 0
  • 98
  • 402

Question #3

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

Question #4