R
Richard
santosh said:jacob said:Richard said:jacob navia said:
H. is arguing that strncmp is not a string comparison function.
Heathfield
That's right. [snip]
Yes, I agree that it's a comparison function. So what?
OK. I give up.
Are you really saying you don't know the difference between a comparison
function and string comparison function?
The crucial difference between strcmp and strncmp is that the former _needs_
it's arguments to be null-terminated strings while the latter doesn't.
There is a crucial difference between an array of characters, (which
needn't, but could be, a string), and a string.
This is another example of petty one upsmanship and word twisting. Both
work almost exactly the bloody same. The difference is that ONE of them
specifies the maximum number of characters to compare. Not a huge
difference but potentially a very optimal difference where the first N
characters are the UID of the object in question.
Yes, CLEARLY strmp needs a well formed string and strncmp doesnt.
To accuse someone of not knowing the difference between a comparison
function and a "string comparison" function is, in this case, trite and
petty when one considers that its very obvious that the poster knows
what the functions do.