Re: [algogeeks] microsoft_c++_qstn

2012-09-25 Thread atul anand
correct...my fault On Wed, Sep 26, 2012 at 12:04 AM, shady wrote: > this is not a sequence point rule... there is only one way of evaluation > here. > correct me if wrong... > > > On Tue, Sep 25, 2012 at 11:26 PM, atul anand wrote: > >> *i = i + i; // *this voilate sequence point rule >

Re: [algogeeks] microsoft_c++_qstn

2012-09-25 Thread shady
this is not a sequence point rule... there is only one way of evaluation here. correct me if wrong... On Tue, Sep 25, 2012 at 11:26 PM, atul anand wrote: > *i = i + i; // *this voilate sequence point rule > output is compiler dependent. > > > On Tue, Sep 25, 2012 at 9:59 PM, Ravi Ranjan

Re: [algogeeks] microsoft_c++_qstn

2012-09-25 Thread atul anand
*i = i + i; // *this voilate sequence point rule output is compiler dependent. On Tue, Sep 25, 2012 at 9:59 PM, Ravi Ranjan wrote: > @atul > > so 8 will be the answer or is it not fixed??? > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" gro

Re: [algogeeks] microsoft_c++_qstn

2012-09-25 Thread Ravi Ranjan
@atul so 8 will be the answer or is it not fixed??? -- 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...@googleg

Re: [algogeeks] microsoft_c++_qstn

2012-09-25 Thread atul anand
voilate sequence point rule...acc to c++ standard no complier to trust On 25 Sep 2012 21:27, "Ravi Ranjan" wrote: > #include > int rec(int i) > { > static int d=1; > if(i>=5) > return i; > d=d+i; > i=i+i; > rec(d); > } > int main() > { > cout< return 0; > } > > various compilers give diffrent res

[algogeeks] microsoft_c++_qstn

2012-09-25 Thread Ravi Ranjan
#include int rec(int i) { static int d=1; if(i>=5) return i; d=d+i; i=i+i; rec(d); } int main() { cout