I think the question should have been quite generic, if it is integer you can go from the void pointer to four bytes ( sizeof(int)) ahead and get the next number that is what is required for us. But what if we do not know what is the member type is ?, How we can get the second member if the first member type of the structure is not know.
a=(float *)((char *)a+sizeof(node)-sizeof(int)); ==> Just modified to subramani. Thanks, Sathaiah Dontula On Thu, Sep 9, 2010 at 12:17 PM, ram das <[email protected]> wrote: > thanks this seems fine. > > > On Wed, Sep 8, 2010 at 1:02 AM, albert theboss <[email protected]>wrote: > >> >> typedef struct list node; >> >> node a; >> >> (float*)((char*)a+2) >> >> is it correct ?? >> correct me i am wrong.... >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Algorithm Geeks" group. >> To post to this group, send email to [email protected]. >> To unsubscribe from this group, send email to >> [email protected]<algogeeks%[email protected]> >> . >> For more options, visit this group at >> http://groups.google.com/group/algogeeks?hl=en. >> > > > > -- > Thanks & Regards > Ram Narayan Das > mob: +91 9177711195 > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<algogeeks%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
