Export (0) Print
Expand All
1 out of 1 rated this helpful - Rate this topic

StrCmpN function

Compares a specified number of characters from the beginning of two strings to determine if they are the same. The comparison is case-sensitive. The StrNCmp macro differs from this function in name only.

Syntax


int StrCmpN(
  _In_  PCTSTR psz1,
  _In_  PCTSTR psz2,
  _In_  int nChar
);

Parameters

psz1 [in]

Type: PCTSTR

A pointer to the first null-terminated string to be compared.

psz2 [in]

Type: PCTSTR

A pointer to the second null-terminated string to be compared.

nChar [in]

Type: int

The number of characters from the beginning of each string to be compared.

Return value

Type: int

Returns zero if the strings are identical. Returns a positive value if the first nChar characters of the string pointed to by psz1 are greater than those from the string pointed to by psz2. It returns a negative value if the first nChar characters of the string pointed to by psz1 are less than those from the string pointed to by psz2.

Requirements

Minimum supported client

Windows 2000 Professional, Windows XP [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Shlwapi.h

Library

Shlwapi.lib

DLL

Shlwapi.dll (version 4.71 or later)

Unicode and ANSI names

StrCmpNW (Unicode) and StrCmpNA (ANSI)

 

 

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.