Re: What u mean by this statemnet ?.



Umesh said:

> what this statement &(*IR)->func means.

This takes the address of the func object that is a member of a structure
that is pointed to by a pointer which is in turn pointed to by IR.

Let's start with IR.

IR is a pointer to a pointer to a struct.
*IR is a pointer to a struct.
(*IR)-> dereferences the struct.
(*IR)->func refers to the func member of the struct.
&(*IR)->func takes the address of the func member.

> where IR is the pointer to structure

It isn't. At least, if it is, the compiler will emit a diagnostic for the
above code.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)
.



Relevant Pages

  • Re: Requesting sample code!
    ... a function can never be a member of a struct. ... Putting a pointer to function in a structure is no different. ... than a pointer to int or pointer to char or pointer to struct. ...
    (microsoft.public.vc.language)
  • Re: void* passed as funtion parameters?
    ... You could then treat the void pointer as pointer to the enumeration, ... "You could also attach the type to the struct itself, ... member an enumeration." ...
    (microsoft.public.vc.language)
  • Re: Another spinoza challenge
    ... You should test against the int type's limits: ... typedef struct complex ... a pointer to an integer ... A macro is preferable because it is replaced by inline code, ...
    (comp.lang.c)
  • Re: how to store list of varying types
    ... represent that with those in the struct definitions? ... pointer null, and the second one the CString object. ... then have to finish constructing the packet by copying the two data objects ... start with an upper-case letter (so, I would use DataElement ...
    (microsoft.public.vc.mfc)
  • Re: Using offsetof to create a pointer to the start of a struct?
    ... dereference a pointer to a struct element to create a pointer to the start ... member that is not the first member in the struct. ... subtracting the hand calculated offset of the member, ...
    (comp.lang.c)