1.  If a variable is a pointer to a structure, then which of the following operator is used to access data members of the structure through the pointer variable?

A. .
B. &
C. *
D. ->

Answer: Option D

Explanation:

"." is used to access elements of a class via an object of class

eg-

class cls
{
public int a;
//some other work in this class
}
void main()
{
cls cls1=new cls();
cls1.a=20;//using "." operator here
}

&(ampersand) = points the address of the variable declared

*(as-trick) = points the value of the variable declared.

->(spangles) = accesses the pointer variable that contains the address of another variable.

Note:

". " : used to access structure members with normal structure variable.

"->" : used to access structure members with pointer to structure.

"*" : used to dereference a pointer.

"&" : used to obtain address of variable.