Multiple choice

When we declare a pointer to a structure, which of the following operators is used to access the structure variable through the pointer object?

  1. .(dot)

  2. * (Asterisk)

  3. & (Ampersand)

  4. -> (Arrow)

  5. # (Hash)

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

The -> (arrow) operator is used to reference individual members of a structures.The arrow operator is used with a pointer to an object. For example, if 'stud' is a pointer object pointing to a structure 'student', then the following statement can be used to access the member of the structure. printf("%d",*s->rollno);