C Programming - Pointers - Discussion

Discussion Forum : Pointers - General Questions (Q.No. 5)
5.
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?
.
&
*
->
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
60 comments Page 4 of 6.

Sayli said:   10 years ago
Good explanation. Thanks @Kisan.

Sumit said:   10 years ago
We can use either (*p).x or p->x where x is the member of the structure.

Dhairya said:   10 years ago
Pointer is a collection of data;& operator access a memory in & by Code block.

Sidhesh said:   1 decade ago
@Ramchandra

Can we write the above code with the help of "." operator ?

Chinna said:   2 decades ago
Because specify the next address.

Sangeetha said:   2 decades ago
Very good keep it up (master brain).

Apurva Nigam said:   2 decades ago
Thanks Kisan for properly explaining.

Kiran said:   2 decades ago
Well said kisan.

Vijaya said:   2 decades ago
When we create structure as a pointer, we have to access those structure members with structure object->structure variable.

Vinoth said:   2 decades ago
Clear explanation Kisan


Post your comments here:

Your comments will be displayed after verification.