Whats the significance of first argument in an if
statement if it's just going to be ignored? For instance, in:
#include<stdio.h>
main()
{
if(1,0)
printf("abc");
else
printf("qwe");
}
That's not an argument list, it's the comma operator.
If you have a statement like foo(), bar()
, then foo()
will be called and its result discarded, then bar()
will be called and the entire statement's result will be bar()
's result. Something like if(foo(),bar())
might be used if calling foo()
has some side effect that needs to happen for some reason.
For something like 1,0
, that is exactly the same as just saying 0
and there is no significance to the 1
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With