You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
strcat : A C function program that concatenates two strings.
Prototype: char *_strcat(char *dest, char *src);
This function appends the src string to the dest string, overwriting the terminating null byte (\0) at the end of dest, and then adds a terminating null byte.
Returns a pointer to the resulting string dest.
FYI: The standard library provides a similar function: strcat. Run man strcat to learn more.
Negative integer if the stopping character in s1 was less than the stopping character in s2
Positive integer if the stopping character in s1 was greater than the stopping character in s2
So when we compare we will only check the difference of the first character found between s1 and s2, break the array iteration and return the difference.
Compile the code this way: gcc -Wall -pedantic -Werror -Wextra -std=gnu89 3-main.c 3-strcmp.c -o 3-strcmp