in main by mistake i wrote all 3 vars of struct as a, make them as a , b ,
c..
ya it is google 35000.000000

On Thu, Jun 23, 2011 at 7:35 PM, Piyush Sinha <[email protected]>wrote:

> I had a doubt which I wanted to ask...for me output is coming as follows
>
> google 0.000000
>
> r u sure ur output is coming to be
> google 35000.000000
>
> On 6/23/11, Anika Jain <[email protected]> wrote:
> > ya *arr[2] is fine but in printing a struct element do we need to give
> all
> > necessary format specifiers for printing??
> >
> > On Thu, Jun 23, 2011 at 7:15 PM, Piyush Sinha
> > <[email protected]>wrote:
> >
> >> for further details.....
> >>
> >> http://en.wikipedia.org/wiki/Comma_operator
> >>
> >> On 6/23/11, Piyush Sinha <[email protected]> wrote:
> >> > the comma operator evaluates its first operand and discards the
> >> > result, and then evaluates the second operand and returns this value.
> >> > instead of 3, whatever u write. the result will depend on the second
> >> > operand i.e x>>1 i.e 2 (5/2 = 2)
> >> >
> >> > On 6/23/11, Anika Jain <[email protected]> wrote:
> >> >> #include<stdio.h>
> >> >> typedef struct
> >> >> {
> >> >>       char *name;
> >> >>        double salary;
> >> >> }job;
> >> >>
> >> >> main()
> >> >> {
> >> >>     static job a={"tcs",15000.0};
> >> >>     static job a={"ibm",25000.0};
> >> >>     static job a={"google",35000.0};
> >> >>     int x=5;
> >> >>     job *arr[3]={&a,&b,&c};
> >> >>      printf("%s %f\t",(3,x>>1)[*arr]);
> >> >> }
> >> >>
> >> >> output: google 35000.000000
> >> >>
> >> >> what this printf statement means plz explain...
> >> >>
> >> >> --
> >> >> 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.
> >> >>
> >> >>
> >> >
> >> >
> >> > --
> >> > *Piyush Sinha*
> >> > *IIIT, Allahabad*
> >> > *+91-8792136657*
> >> > *+91-7483122727*
> >> > *https://www.facebook.com/profile.php?id=100000655377926 *
> >> >
> >>
> >>
> >> --
> >> *Piyush Sinha*
> >> *IIIT, Allahabad*
> >> *+91-8792136657*
> >> *+91-7483122727*
> >> *https://www.facebook.com/profile.php?id=100000655377926 *
> >>
> >> --
> >> 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.
> >
> >
>
>
> --
> *Piyush Sinha*
> *IIIT, Allahabad*
> *+91-8792136657*
> *+91-7483122727*
> *https://www.facebook.com/profile.php?id=100000655377926 *
>
> --
> 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.

Reply via email to