std::strncmp() function lexicographically compares not more than count characters from the two null-terminated strings and returns an integer based on the outcome.
- This function takes two strings and a number num as arguments and compare at most first num bytes of both the strings.
- num should be at most equal to the length of the longest string. If num is defined greater than the string length than comparison is done till the null-character(‘