LearnFrenzy
Sign in Take a free test

Structures, Unions, Enums · Exercise 1 of 4

Structures, Unions, Enums Structures, Unions & Enums MCQ

  • 12 questions
  • Page 2 of 2
  • Answers explained
0Attempted
0Correct
0Wrong
Directions

Twelve multiple-choice questions on structures, unions and enums – including padding, flexible array members, bit-fields, anonymous members (C11) and C23 enums. Pick an option to check your answer instantly.

Question 11 Hard

What does enum status : unsigned char { OK, FAIL }; do in C23?

A It is a syntax error
B It fixes the enum's underlying type, so sizeof(enum status) is 1
C It limits the enum to 2 values
D It makes OK and FAIL characters
Question page & discussion
Question 12 Easy

Why must a linked-list node be declared as struct node { int v; struct node *next; }; and not with struct node next;?

A Pointers are faster
B A struct cannot contain an object of its own type – it would be infinitely large – but it can contain a pointer to one
C struct node is not defined yet, so nothing can refer to it
D Both declarations are valid
Question page & discussion
Up next · Exercise 2Predict the Output12 questions

Ready to test your Programming?

Timed online tests with instant scores and explanations.

Search LearnFrenzy

Esc

Quick links