Suggest a book for tricky questions in C example unusual if condition [duplicate]

StackOverflow https://stackoverflow.com/questions/6397099

  •  29-10-2019
  •  | 
  •  

Possible Duplicate:
What does the ',' operator do in C?

Ok I had an interview today and they asked me what should be the output of the following code

#include<stdio.h>

int main ()
{

int a=1,b=1;
char c='0';
if(a,b,c)
   printf("wow \n");
}

after running it on my machine I am able to get the answer but I was not able to answer there.I want to know if such a if statement is allowed? Where is it mentioned?

My problem is the if condition mentioned above I am not able to understand how does that if statement work.

**UPDATE **
I did not found any such thing in K&R can any one recommend a good book.I have programmed things and not new to C but still after failing this question I want to once more look if some more C concepts in depth (specially such as above) are mentioned where can I read.

没有正确的解决方案

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top