
Exploring C Structures, Unions, and Files

Quiz
•
Information Technology (IT)
•
12th Grade
•
Hard
gb thapa
Used 1+ times
FREE Resource
20 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the syntax to define a structure in C?
StructName struct { memberName dataType; };
struct StructName: dataType memberName;
struct StructName { dataType memberName; };
struct { memberName: dataType } StructName;
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you access a member of a structure in C?
Access members using the asterisk operator (*) only.
Use the semicolon operator (;) to access members.
Use the dot operator (.) or the arrow operator (->) depending on whether you have a structure variable or a pointer.
Members can be accessed by their index number like arrays.
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the primary difference between a structure and a union in C?
A structure can hold only one value at a time, while a union can hold multiple values simultaneously.
Structures and unions are identical in functionality and usage.
A structure can only contain primitive data types, while a union can contain complex data types.
A structure can hold multiple values simultaneously, while a union can hold only one value at a time.
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you define a union in C?
union union_name { data_type1 member1; data_type2 member2; ... };
enum enum_name { value1, value2, ... };
class class_name { data_type1 member1; data_type2 member2; ... };
struct struct_name { data_type1 member1; data_type2 member2; ... };
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What happens to the memory allocation of a union when a new member is assigned?
The memory allocation remains the same; it is shared among all members.
The memory allocation is reset to zero when a new member is assigned.
Memory is allocated separately for each member of the union.
The memory allocation increases for each new member assigned.
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Can a structure contain a union as a member?
Yes, a structure can contain a union as a member.
No, a union cannot be a member of a structure.
Only classes can contain unions as members.
Structures and unions are mutually exclusive.
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the purpose of the 'sizeof' operator in relation to structures?
The 'sizeof' operator calculates the number of elements in a structure.
The 'sizeof' operator is used to define a structure's members.
The 'sizeof' operator determines the size of a structure in bytes.
The 'sizeof' operator converts a structure to a string representation.
Create a free account and access millions of resources
Similar Resources on Wayground
25 questions
LATIHAN SOAL INFORMATIKA KLS 7

Quiz
•
7th Grade - University
15 questions
Emp. Tech. 12 - Intro to MS Excel Quiz

Quiz
•
12th Grade - University
20 questions
YEAR 7 MID-TERM ASSESSMENT

Quiz
•
7th Grade - University
24 questions
Aplication Domain: Social Media and Crowdsourcing

Quiz
•
12th Grade - University
15 questions
Lesson 5: Using and Manipulating Data

Quiz
•
9th - 12th Grade
15 questions
STP_Integrasi aplikasi

Quiz
•
9th Grade - University
20 questions
Quiz Administrasi Perkantoran

Quiz
•
9th Grade - University
20 questions
Etika Di Laboratorium Informatika

Quiz
•
9th - 12th Grade
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Information Technology (IT)
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
10 questions
Video Games

Quiz
•
6th - 12th Grade
28 questions
Ser vs estar

Quiz
•
9th - 12th Grade
13 questions
BizInnovator Startup - Experience and Overview

Quiz
•
9th - 12th Grade
16 questions
AP Biology: Unit 1 Review (CED)

Quiz
•
9th - 12th Grade
20 questions
Parallel lines and transversals

Quiz
•
9th - 12th Grade
9 questions
Geometry and Trigonometry Concepts

Interactive video
•
9th - 12th Grade
10 questions
Angle Relationships with Parallel Lines and a Transversal

Quiz
•
9th - 12th Grade