Curtis Gilchrist wrote:
To compare two arrays, you can use strncmp from <string.h> or
std::char_traits<char>::compare from <string>.
Jonathan
I thought that was used only for testing equality?
From the draft C standard:
7.21.4.2 The strcmp function
Synopsis
[#1]
#include <string.h>
int strcmp(const char *s1, const char *s2);
Description
[#2] The strcmp function compares the string pointed to by
s1 to the string pointed to by s2.
Returns
[#3] The strcmp function returns an integer greater than,
equal to, or less than zero, accordingly as the string
pointed to by s1 is greater than, equal to, or less than the
string pointed to by s2.
Brian Rodenborn