MicrOS
strcmp.c File Reference
#include "../string.h"

Functions

int strcmp (const char *str1, const char *str2)
 Compare two strings. More...
 

Function Documentation

◆ strcmp()

int strcmp ( const char *  str1,
const char *  str2 
)

Compare two strings.

Compares the C string str1 to the C string str2. This function starts comparing the first character of each string. If they are equal to each other, it continues with the following pairs until the characters differ or until a terminating null-character is reached.

Parameters
str1C string to be compared.
str2C string to be compared.
Returns
Returns an integral value indicating the relationship between the content of the memory blocks (<0: value in ptr1 was lower than in ptr2, 0: both are equals, >0: value in ptr2 was greater than in ptr2).