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 4 of 6.
Ashish said:
9 years ago
I think the answer given to the question is wrong.
We can use(*p).x instead of using ->.
We can use(*p).x instead of using ->.
(3)
Nayan Shrimal said:
1 decade ago
Because it is a De-reference operator (->). So the data members can easily accessible.
Vishwanath sampath said:
1 decade ago
Pointer is a address of value. Then will find the address if you are submit that values.
Dhairya said:
9 years ago
Pointer is a collection of data;& operator access a memory in & by Code block.
Rama saranya said:
1 decade ago
-> is member off pointer operator as we use for accessing the structure variable.
Sidhesh said:
1 decade ago
@Ramchandra
Can we write the above code with the help of "." operator ?
Can we write the above code with the help of "." operator ?
Nitin verma said:
1 decade ago
-> indicates direction toward's something and pointer is used for that in c.
Sumit said:
9 years ago
We can use either (*p).x or p->x where x is the member of the structure.
Haarika said:
1 decade ago
What is enum? in what situation we use it? can anybody help me out? please.
Mamta said:
1 decade ago
Actually address part of node represented by ->.
obj->pointer.
obj->pointer.
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers