[algogeeks] Re: Good question

2011-02-06 Thread Ricky
@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 wrote: > @rajiv:i guess obj is a pointer here > > > > > > > > On Mon, Feb 7, 2011 at 10:51 AM, Rajiv Podar wrote: > > Hi > > Try following code > > > Suppo

Re: [algogeeks] Re: Good question

2011-02-06 Thread jagannath prasad das
@rajiv:i guess obj is a pointer here On Mon, Feb 7, 2011 at 10:51 AM, Rajiv Podar 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 A

Re: [algogeeks] Re: Good question

2011-02-06 Thread Rajiv Podar
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 wrote: > using this macro > > size(X) ((X*)0+1) > > > > if we give size(int) it ll return 4. > size(d

Re: [algogeeks] Re: Good question

2011-02-06 Thread albert theboss
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 gro

Re: [algogeeks] Re: Good question

2011-02-06 Thread jaladhi dave
it has variable defined On Sun, Feb 6, 2011 at 7:47 AM, Venki wrote: > Hi Gajendra, > See the following link > > http://geeksforgeeks.org/forum/topic/huwaei-interview-question-for-software-engineerdeveloper-2-5-years-about-cpuzzles#post-18725 > > > On Feb 5, 7:28 pm, Gajendra Dadheech wrote: >>

[algogeeks] Re: Good question

2011-02-05 Thread Venki
Hi Gajendra, See the following link http://geeksforgeeks.org/forum/topic/huwaei-interview-question-for-software-engineerdeveloper-2-5-years-about-cpuzzles#post-18725 On Feb 5, 7:28 pm, Gajendra Dadheech wrote: > Calculate size of a data type without using sizeof and without declaring any > vari

Re: [algogeeks] Re: good question

2010-12-24 Thread bhupendra dubey
@Dave nice algorithm On Fri, Dec 24, 2010 at 6:59 PM, Dave wrote: > @Monty: Use an alternating across and down algorithm: > > Set the current row = the first row > While current row is not the last row >Look across the current row for the first false >Look down the column containing that

[algogeeks] Re: good question

2010-12-24 Thread Dave
@Monty: Use an alternating across and down algorithm: Set the current row = the first row While current row is not the last row Look across the current row for the first false Look down the column containing that first false for a true If no such row is found, break. // current row is