ACtE03 · Chapter 3Programming & Applications🏛️ Past Licensure QuestionID: 77c434fe
In C, which operator is used to access a member of a non-pointer (direct instance) structure variable?
In C, which operator is used to access a member of a non-pointer (direct instance) structure variable?
Multiple Choice Options
- A
Arrow operator (
->) - B✓ Correct Option
Dot operator (
.) - C
Scope resolution operator (
::) - D
Address-of operator (
&)
Detailed Technical Solution & Explanation
In C, direct structure variables use the dot operator . (struct_var.member). The arrow operator -> is used when accessing members through a pointer (ptr->member, equivalent to (*ptr).member).
Option Analysis:
•
Option A (Arrow operator (
->)): Used when accessing members via a structure pointer.•
Option B (Dot operator (
.)): Correct. Directly selects a member from a structure value instance.•
Option C (Scope resolution operator (
::)): C++ operator for namespaces/classes, not present in C.•
Option D (Address-of operator (
&)): Yields the memory address of an object.Reference: Demo2 · Set 1NEC Licensure Syllabus