What does it mean when string 1 is "less than" string 2 in C? -


this question has answer here:

in documentation of strncmp(const char *s1, const char *s2, size_t n) function of xc8 compiler, read:

the strncmp() function compares two, null terminated, string arguments, maximum of n characters, , returns signed integer indicate whether s1 less than, equal or greater s2. comparison done standard collating sequence, of ascii character set.

what mean when s1 less than s2? charcount lower, or sum of characters, or ...? function ever return 0 when stuff {'a',0x00} , {'a',0x00,0x00} inputted?

could please explain clear example?

it means s1 come before s2 in dictionary or directory listing sorted lexically, etc. more clear example might "aaa" less "bbb", "aab" less "abb".


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -