Seen quite a bit of code example with -> in them, like this
*hostEntry->h_addr_list
but what's this -> as it does not seem to be mentioned in the various tutorials I've been learning from :confused:
Thanks
dicky
Printable View
Seen quite a bit of code example with -> in them, like this
*hostEntry->h_addr_list
but what's this -> as it does not seem to be mentioned in the various tutorials I've been learning from :confused:
Thanks
dicky
you can access the elements of a struct with this "->" operater, if there is just a pointer to the struct.
Look at the section explaining the -> operator.
http://www.iota-six.co.uk/c/h3_structs_part_2.asp
FAQ Entry for you to read:
http://faq.cprogramming.com/cgi-bin/...&id=1073086407
in addition to what iceball said it can also be used to access objects of a class using a pointer. :)
alvarorahul says...
Only as stated with a pointer to an instance (object) of the class.Quote:
in addition to what iceball said it can also be used to access objects of a class using a pointer.
Besides that is C++ and this is the C message board. ;)
How could you forget unions? ;)
Quzah.
quite easily :)Quote:
Originally Posted by quzah