c - Explain the output of following? -


#include<stdio.h> void main() {     char ch;     if((ch=printf(1234))         printf("a");     else         printf("b"); } 

answer b : don't know value assigned ch , happens printf(1234)

from printf(3) man page:

return value    upon successful return, these functions return number of characters    printed  (not  including   trailing  '\0'  used   end  output    strings). 

Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -