@rajiv:i guess obj is a pointer here........ On Mon, Feb 7, 2011 at 10:51 AM, Rajiv Podar <[email protected]> wrote:
> Hi > Try following code > > Suppose we need to find size of variable *"obj"* > int size = (char*)(obj +1 ) - (char*)(obj); > > * > *Thanks & Regards, > Ricky > > > > On Mon, Feb 7, 2011 at 12:19 AM, albert theboss > <[email protected]>wrote: > >> using this macro >> >> size(X) ((X*)0+1) >> >> >> >> if we give size(int) it ll return 4. >> size(double) gives 8. >> >> -- >> 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. >> > > -- > 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. > -- 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.
