@jagan: that's true obj is a pointer to the data type for which size need to be calculated.
On Feb 7, 10:38 am, jagannath prasad das <jpdasi...@gmail.com> wrote: > @rajiv:i guess obj is a pointer here........ > > > > > > > > On Mon, Feb 7, 2011 at 10:51 AM, Rajiv Podar <rajeevpo...@gmail.com> 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 > > <alberttheb...@gmail.com>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 algogeeks@googlegroups.com. > >> To unsubscribe from this group, send email to > >> algogeeks+unsubscr...@googlegroups.com. > >> 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 algogeeks@googlegroups.com. > > To unsubscribe from this group, send email to > > algogeeks+unsubscr...@googlegroups.com. > > 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 algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.