I was looking into some old code in my product and i found following code.
#include <stdio.h>
#include <string.h>
int main ( int argc, char **argv) {
const char *str = "abcdefghi";
int value = strcmp(str, "abcdefghi") == 0;
}
What is the purpose of int value = strcmp(str, "abcdefghi") == 0; of such code.
It initializes
valuewith the result ofstrcmp(str, "abcdefghi") == 0which will be0or1depending on whatstrcmpreturns.