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?Select one:a..b.&c.*d.->
Question
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?Select one:a..b.&c.*d.->
Solution
The correct answer is d. ->
This operator is used to access data members of a structure through a pointer variable. In C and C++, if you have a pointer to a structure, you can access its members using the -> operator. For example, if 'ptr' is a pointer to a structure and 'member' is a member of that structure, you can access 'member' with 'ptr->member'.
Similar Questions
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? ans. -> * . &
Which operator is used to access data members of the outer structure?
How do you access a member of a structure using a structure pointer in C?*1 pointWith the dot operator (.)With the arrow operator (->)With the ampersand (&)With the asterisk (*
The operator used to get value at address stored in a pointer variable isa.*b.&c.&&d.||
Which of the following structure(s) is/are correct? Tick all correct answer(s) No partial marks and no negative marks.Select one or more:struct aa { int a; float b; };struct aa { int a; float b; struct aa var; };struct aa { int a; float b; struct aa *var; };
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.