Why is this code returning -1
?
memcmp()
compares block of memory and takes 3 parameters in constructor but what happens when I miss the third parameter?
int main()
{
char ptr[] = "hello";
char ptr1[] = "hello";
int a = memcmp(ptr,ptr1);
printf("%d",a);
return 0;
}
Also the following program abruptly terminates without the third parameter:
int main()
{
char *ptr = "hello";
char *ptr1 = "hello";
int a = memcmp(ptr,ptr1);
printf("%d",a);
return 0;
}