Quiz Yourself on Arrays

Test your understanding of the material related to arrays and pointers.

Arrays and pointers

1

Given the following code:

#include <stdio.h>

int x[5];

int main()
{
	int y[3];
	static int z[2] = {0, 1};

	return 0;
}

Where are x, y, and z stored?

A)
  • x is placed inside the data section.
  • y is placed on the stack.
  • z is placed inside the bss section.
B)
  • x is placed inside the bss section.
  • y is placed on the stack.
  • z is placed inside the data section.
C)
  • x is placed inside the data section.
  • y is placed in the data section.
  • z is placed inside the bss section.
D)
  • x is placed inside the data section.
  • y is placed on the stack.
  • z is placed on the stack.
Question 1 of 50 attempted

Get hands-on with 1400+ tech skills courses.