Re: [algogeeks] Re: Concept of Pointer

2011-08-24 Thread Avinash LetsUncomplicate..
++ is simply post increment will increment after use
so *s is printed in first printf.. precedence doesnt matter coz its a
single operand on which post increment has to be done also no copncept
of associativity i think associativity is for same precedence
operators  ..





Avinash
NIT allahabad

-- 
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.



Re: [algogeeks] Re: Concept of Pointer

2011-08-24 Thread Dheeraj Sharma
* and + have same precedence so right to left associatvty for first
printf..and the rest printf statements are similar

On Wed, Aug 24, 2011 at 2:54 PM, Avinash LetsUncomplicate.. 
avin.2...@gmail.com wrote:

 ++ is simply post increment will increment after use
 so *s is printed in first printf.. precedence doesnt matter coz its a
 single operand on which post increment has to be done also no copncept
 of associativity i think associativity is for same precedence
 operators  ..





 Avinash
 NIT allahabad

 --
 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.




-- 
*Dheeraj Sharma*
Comp Engg.
NIT Kurukshetra
+91 8950264227

-- 
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.



Re: [algogeeks] Re: Concept of Pointer

2011-08-22 Thread Sanjay Rajpal
+1 to ADITI.


Sanju
:)



On Mon, Aug 22, 2011 at 2:51 PM, Ashish Sachdeva ashish.asachd...@gmail.com
 wrote:

 for the 1st printf i hv this explanation:
 precedence of ++ is greater then *   ... but associativity of both of
 them is right to left...
 thats why dereferenced takes place 1st and then the pointer is
 incremented...

 rest is fine...

 correct me if i m wrong...

 On Aug 22, 3:47 pm, aditi garg aditi.garg.6...@gmail.com wrote:
  in frst printf we acess *s and s is incremented later...so it prints A bt
 at
  the same time s points to B now...
  In 2nd printf s is incremented frst and thn dereferencd...after
 incrementing
  it points to C and whn we dereference it we get C
  in the third printf *s=C whn we increment this we get D
  so the ans wud be ACD...
  I hope its  clear
 
 
 
 
 
 
 
 
 
   On Mon, Aug 22, 2011 at 4:03 PM, MANNU manishkr2...@gmail.com wrote:
   main()
   {
   char ch[]=ABCD;
   char *s;
   s=ch;
   printf(%c,*s++);
   printf(%c,*++s);
   printf(%c,++*s);
   }
 
   Can anyone plz tell me the concept behind output??
 
   --
   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.
 
  --
  Aditi Garg
  Undergraduate Student
  Electronics  Communication Divison
  NETAJI SUBHAS INSTITUTE OF TECHNOLOGY
  Sector 3, Dwarka
  New Delhi

 --
 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.