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

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -