Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

_strnicmp vs. strncmp

254 views
Skip to first unread message

nly

unread,
Feb 1, 2006, 2:32:17 AM2/1/06
to
Both _strnicmp and strncmp are documented in MSDN's Run-Time Library
Reference

_strnicmp, _wcsnicmp, _mbsnicmp

vs.

strncmp, wcsncmp, _mbsncmp

What're the purposes of having both? What's the meaning of underscore for C
Run-Time Library functions?

Thanks in advance!


Ulrich Eckhardt

unread,
Feb 1, 2006, 3:46:13 AM2/1/06
to
nly wrote:
> Both _strnicmp and strncmp are documented in MSDN's Run-Time Library
> Reference
>
> _strnicmp, _wcsnicmp, _mbsnicmp
>
> vs.
>
> strncmp, wcsncmp, _mbsncmp
>
> What're the purposes of having both?

Notice the 'i'? IIRC that means that the whole thing works case-insensitive.

> What's the meaning of underscore for C Run-Time Library functions?

Dunno, I haven't observed any pattern with these.

Uli

Alex Blekhman

unread,
Feb 1, 2006, 3:48:09 AM2/1/06
to
nly wrote:
> Both _strnicmp and strncmp are documented in MSDN's
> Run-Time Library Reference
>
> _strnicmp, _wcsnicmp, _mbsnicmp
>
> vs.
>
> strncmp, wcsncmp, _mbsncmp
>
> What're the purposes of having both?

You should read documentation more carefully. Here's quiote
from strncmp description:
-------
The strncmp function lexicographically compares, at most,
the first `count' characters in string1 and string2 and
returns a value indicating the relationship between the
substrings. strncmp is a case-sensitive version of
_strnicmp. wcsncmp and _mbsncmp are case-sensitive versions
of _wcsnicmp and _mbsnicmp.
-------

> What's the meaning
> of underscore for C Run-Time Library functions?

"ANSI C Compliance"
http://msdn2.microsoft.com/en-us/library/45aft37a.aspx


0 new messages