On Jun 21, 3:21 pm, "J. J. Farrell" <j...@bcs.org.ukwrote:
On Jun 21, 3:11 am, !truth <noddy_zh...@asustek.com.cnwrote:
On 6 21 , 1 45 , Amar Kumar Dubedy <adub...@yahoo.co.inwrote:
can v write a.foo() in c?? if so how can v do it?? It is a yahoo
interview question.
always, using '->' instead of '.' is a better way ^_^
Using "->" is only useful when we are playing with pointer to
structure . Say, if we are having a pointer to sturcture p , then to
access a member of the structure through this pointer we will have to
write (*p).member . Since the use of pointer to structure is common, C
has been provided with a simpler way to access structure members i.e.
p->member .
In the above situation, i believe there is no benefit of using -.
>
What's better about it?