the two string functions strcpy and strcmp are completely different functions.
the difference is strcpy copies a string to an array, whereas strcmp compares the two strings for order.
for example.
Code:
strcmp("HELLO", "WORLD") // returns -1
strcmp("HELLO", "HELLO") // returns 0
strcmp("WORLD", HELLO") // returns 1
what the tutorial is saying is that when you copy a string into an array using strcpy and then cmp the two strings using strcmp, strcmp will return 0
try the code below
Code:
#include <stdio.h>
#include <string.h>
int main(void) {
char s1[] = "Hello World", s2[12];
strcpy(s2, s1);
printf("compare s1 and s2 = %d\n", strcmp(s1, s2)); // this prints ... = 0
return 0;
}
read your quote again and it will be obvious.