c - Can we include "strcmp" in printf statement? -


can explain meaning of line of code

      printf("%d",strcmp("strcmp()","strcmp()")) 

the code joke...

it compares 2 fixed strings. make confusing 2 strings contain name of library function (strcmp) - of cause - doesn't make function call.

the code

printf("%d",strcmp("strcmp()","strcmp()")) 

is similar to

printf("%d",strcmp("a","a")) 

it print 0 (zero) strings identical , strcmp return 0 when strings have exact compare.


Comments

Popular posts from this blog

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -