S
Sweety
#include<stdio.h>
void main()
{
int a=0,b=6,c=7,d=8,e;
e = a ? c , b : c , d;
printf("%d",e);
}
o/p->7
void main()
{
int a=0,b=6,c=7,d=8,e;
e = a ? c , b : c , d;
printf("%d",e);
}
o/p->7
Something said:#include<stdio.h>
void main()
{
int a=0,b=6,c=7,d=8,e;
e = a ? c , b : c , d;
printf("%d",e);
}
o/p->7
Sweety wrote:
[crap indicating that "Sweety" never checks a FAQ, never checks past
traffic in a news group, never has read a non-Schildt textbook on C; or
else is just trolling.]
I don't quite get the output of his programm either. I changed it a bit,
and got similar output I don't quite understand.
I did the following
#include <stdio.h>
int main(void) {
int e;
e= 0 ? 1,2 : 3,4;
printf("%d", e);
return 0;
}
I get the output 3, however I think it should be for, no matter in which
order you evaluate. I also did the following:
[snip]
Is it correct that the comma operator takes even less precedence than the
= operator?
Till Crueger said:I don't quite get the output of his programm either. I changed
it a bit, and got similar output I don't quite understand.
I did the following
#include <stdio.h>
int main(void) {
int e;
e= 0 ? 1,2 : 3,4;
printf("%d", e);
return 0;
}
I get the output 3, however I think it should be for, no
matter in which order you evaluate.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.