ACtE03 · Chapter 3Programming & Applications🏛️ Past Licensure QuestionID: b8a548b2
In C, which construct allows passing and manipulating strings or character buffers efficiently through functions using structures?
In C, which construct allows passing and manipulating strings or character buffers efficiently through functions using structures?
Multiple Choice Options
- A✓ Correct Option
A structure containing character array members or character pointers (
char *) - B
A union without member tags
- C
Bit-fields only
- D
Preprocessor object macros
Detailed Technical Solution & Explanation
In C, bundling text within a structure using char array[] or char * allows the structure instance or its pointer to be passed cleanly across function boundaries, carrying length and metadata together.
Option Analysis:
•
Option A (A structure containing character arra...): Correct. Standard pattern for string management in C structs.
•
Option B (A union without member tags): Cannot safely carry multiple independent text attributes.
•
Option C (Bit-fields only): Used for packing sub-byte flag bits, not strings.
•
Option D (Preprocessor object macros): Preprocessor text replacements, not data structures.
Reference: Demo2 · Set 2NEC Licensure Syllabus