
Array of Structures 2

Quiz
•
Computers
•
University
•
Medium
Karen Tan
Used 1+ times
FREE Resource
40 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 20 pts
Which of the following declares an array of structures of size 5, where each structure holds two integers (x and y)?
struct point arr[5];
struct point arr[] = {x: 1, y: 2};
struct point {int x; int y;} arr[5];
struct point arr = {1, 2};
2.
MULTIPLE CHOICE QUESTION
1 min • 20 pts
What is the correct way to access the second element’s x field of an array of structures called points?
points[1].x;
points[0].x;
points.x[1];
points.x[2];
3.
MULTIPLE CHOICE QUESTION
1 min • 20 pts
Given a pointer p to an array of structures, which statement accesses the third element's y field?
p[2].y;
(*p[2]).y;
(*p).y[2];
p->y[2];
4.
MULTIPLE CHOICE QUESTION
1 min • 20 pts
Which of the following code snippets correctly traverses an array of structures points of size 5 and prints all the x values?
for (int i = 0; i arr[0] = 10;
for (int i = 0; i < 5; i++) printf("%d", points[i].x);
for (int i = 0; i < 5; i++) printf("%d", arr[i].x);
struct data {int arr[5];} *d; d.arr[0] = 10;
5.
MULTIPLE CHOICE QUESTION
1 min • 20 pts
What is the correct way to access the y value of the second point using a pointer to the array?
points[1].y;
points->y;
points[2].y;
points[1]->y;
6.
MULTIPLE CHOICE QUESTION
1 min • 20 pts
What is the correct way to calculate the size of an array of structures arr containing 10 elements of type struct point?
sizeof(arr);
sizeof(arr) / sizeof(struct point);
sizeof(struct point) / sizeof(arr);
sizeof(arr) / sizeof(struct point*);
7.
MULTIPLE CHOICE QUESTION
1 min • 20 pts
Which of the following accesses the field y in the nested structure inner_var?
outer.inner_var.y;
outer.inner_var->y;
outer->inner_var.y;
outer.inner_var[1].y;
Create a free account and access millions of resources
Similar Resources on Wayground
44 questions
LATIHAN PYTHON

Quiz
•
10th Grade - University
40 questions
Python Final

Quiz
•
University
40 questions
Power Point - Photoshop

Quiz
•
6th Grade - University
40 questions
PRF192 (41 - 80)

Quiz
•
University
41 questions
Q2 PKS II TPB 10

Quiz
•
University
40 questions
Quiz Tipe Data dan Fungsi

Quiz
•
University
45 questions
Event Driven Handouts 1 & 2

Quiz
•
University
35 questions
SOAL PSAS Informatika XI.5

Quiz
•
11th Grade - University
Popular Resources on Wayground
10 questions
SR&R 2025-2026 Practice Quiz

Quiz
•
6th - 8th Grade
30 questions
Review of Grade Level Rules WJH

Quiz
•
6th - 8th Grade
6 questions
PRIDE in the Hallways and Bathrooms

Lesson
•
12th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
15 questions
Subtracting Integers

Quiz
•
7th Grade
Discover more resources for Computers
15 questions
Let's Take a Poll...

Quiz
•
9th Grade - University
2 questions
Pronouncing Names Correctly

Quiz
•
University
34 questions
WH - Unit 2 Exam Review -B

Quiz
•
10th Grade - University
21 questions
Mapa países hispanohablantes

Quiz
•
1st Grade - University
10 questions
Transition Words

Quiz
•
University
5 questions
Theme

Interactive video
•
4th Grade - University
25 questions
Identifying Parts of Speech

Quiz
•
8th Grade - University
10 questions
Spanish Greetings and Goodbyes!

Lesson
•
6th Grade - University