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?
Discussion:
60 comments Page 3 of 6.
Saurabh said:
1 decade ago
Pointer variable can also be accessible by two type
Type:1
(*a).p//if a is the pointer variable of p.
type:2
It can also be written same as..
a->p;
Type:1
(*a).p//if a is the pointer variable of p.
type:2
It can also be written same as..
a->p;
Ronit said:
1 decade ago
Can anybody say what is the actual difference, when we acces the member of struct by using "." operator & "->" operator ?
Dhanalakshmi said:
1 decade ago
An individual structure member can be accessed in terms of its corresponding pointer variable by writing.
ptr -> member.
ptr -> member.
Kamlesh sharma said:
1 decade ago
Pointer definition: it can store the & of the other variable, so we are using pointer, using arrow "->", operator, ". ", dot operator are used in pointer.
Appala prathyusha said:
1 decade ago
In the ex given by @Puja I have executed the program in online C compiler and executor. I got the output 0.
Mamta said:
1 decade ago
Actually address part of node represented by ->.
obj->pointer.
obj->pointer.
Anukul said:
1 decade ago
"." is not actually referred to as a "dot" operator....it is an "direct selector".
"->" is an "indirect selector".
"->" is an "indirect selector".
Rama saranya said:
1 decade ago
-> is member off pointer operator as we use for accessing the structure variable.
Vaishali said:
1 decade ago
Thanks Pavan Sharath for clearify Structure.
Sayli said:
9 years ago
Good explanation. Thanks @Kisan.
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers