Interesting function. It returns 1 (no match) if any character matches. If no characters match, it returns 0 (meaning a match).

You need to review what the return codes from strncmp() mean. 1 doesn't mean "the same." Also, this loop can potentially overrun the string. What if somebody passes a value for num which is larger than either of the two string lengths? Etc.

11-17-2007

Magos

If you're just interested in equality use the overloaded == or != operator: