对数字字符串使用 strcmp() 感到困惑

Confusion with usage of strcmp() for number strings

{
    char array[2][10]={"3234","5"};
    int n=strcmp(array+0,array+1);
    printf("%d",n);

}

What is the logic behind the results?

strcmp 比较字符串中的字符,使用它们的值作为 unsigned char。首先,它将一个字符串的第一个字符与另一个字符串的第一个字符进行比较。如果它们不同,如​​果第一个字符串的字符小于另一个字符串,则报告第一个字符串“小于”第二个字符串,如果第一个字符串的字符大于另一个字符串,则报告“大于”。如果字符相等,则 strcmp 比较字符串的第二个字符,然后是第三个,依此类推。 (如果一个字符串比另一个短,但直到最后都相同,终止它的空字符将导致它小于另一个字符串。)

So, is there a way to compare two number strings without comapring their actual integer values?

没有这方面的标准库例程。你可以为它写一个例程。