*ft_strcmp
Subject
Assignment name : ft_strcmp
Expected files : ft_strcmp.c
Allowed functions:
--------------------------------------------------------------------------------
Reproduce the behavior of the function strcmp (man strcmp).
Your function must be declared as follows:
int ft_strcmp(char *s1, char *s2);
Man Page
STRCMP(3) (simplified)
NAME
strcmp -- compare strings
SYNOPSIS
#include <string.h>
int strcmp(const char *s1, const char *s2);
DESCRIPTION
The strcmp() and strncmp() functions lexicographically compare the null-
terminated strings s1 and s2.
RETURN VALUES
The strcmp() and strncmp() functions return an integer greater than,
equal to, or less than 0, according as the string s1 is greater than,
equal to, or less than the string s2. The comparison is done using
unsigned characters, so that β\200β is greater than β\0β.
Commented solution
Last updated
Was this helpful?