网站首页  词典首页

请输入您要查询的函数:

 

术语 lstrcmp
释义 lstrcmp
语法:
int lstrcmp( LPCTSTR lpString1,
LPCTSTR lpString2
);
lstrcmp函数
比较两个字符串。这种比较是区分大小写的。
要执行的比较是不区分大小写,使用lstrcmpi功能。
参数
lpString1
[in]指向第一个空结尾的字符串进行比较。
lpString2
[in]指向第二个空结尾的字符串进行比较。
返回值
如果字符串指向lpString1是小于字符串指出lpString2的,则返回值为负。如果字符串指向lpString1比字符串更大指出lpString2的,返回值是积极的。如果字符串相等,则返回值为0。
备注
该lstrcmp函数通过检查比较互相的第一个字符两个字符串,对对方的第二个字符,依此类推,直到找到一个不平等或达到的字符串的结束。
请注意,lpString1和lpString2参数必须空终止,否则字符串比较是不正确的。
函数调用CompareString,使用当前线程的区域设置,结果减去2,保持C运行时间比较字符串公约。
该语言(用户区域),是由用户设定的时间,或通过控制面板,选择确定哪个字符串大于(或字符串是否相同)。如果没有语言(用户区域设置)被选中,系统执行的使用默认值的比较。
有了一个双字节字符集(DBCS)系统的版本,这个功能可以比较两个DBCS字符串。
该lstrcmp函数使用一个字排序,而不是字符串排序。一个字排序对待不同的连字符和撇比对待其他符号的非字母数字,以确保词,如“笼”和“合作社”,停留在已排序的清单。对于各种各样的单词和字符串排序的详细讨论,请参阅该CompareString功能备注部分。
在Windows 95/98/Me:lstrcmpW是支持微软层对于Unicode。要使用此,您必须将某些文件到您的应用,概述了对Unicode的Microsoft层在Windows 95/98/Me系统。
例如
有关示例,请参见确定一个共享位置。
功能信息
最低DLL版本 kernel32.dll
在Winbase.h HeaderDeclared,头文件:winuser.h
import libraryKernel32.lib
最低操作系统Windows 95,Windows NT 3.1
UnicodeImplemented为ANSI和Unicode版本。
参见
Strings 概述 ,整理,CompareString,CompareStringEx,CompareStringOrdinal,lstrcat,lstrcmpi,lstrcpy,lstrlen
==英文原文==lstrcmp Function
Compares two character strings. The comparison is case-sensitive.
To perform a comparison that is not case-sensitive, use the lstrcmpi function.
Syntax
int lstrcmp( LPCTSTR lpString1,
LPCTSTR lpString2
);
Parameters
lpString1
[in] Pointer to the first null-terminated string to be compared.
lpString2
[in] Pointer to the second null-terminated string to be compared.
Return Value
If the string pointed to by lpString1 is less than the string pointed to by lpString2, the return value is negative. If the string pointed to by lpString1 is greater than the string pointed to by lpString2, the return value is positive. If the strings are equal, the return value is zero.
Remarks
The lstrcmp function compares two strings by checking the first characters against each other, the second characters against each other, and so on until it finds an inequality or reaches the ends of the strings.
Note that the lpString1 and lpString2 parameters must be null-terminated, otherwise the string comparison can be incorrect.
The function calls CompareString , using the current thread locale, and subtracts 2 from the result, to maintain the C run-time conventions for comparing strings.
The language (user locale) selected by the user at setup time, or through Control Panel, determines which string is greater (or whether the strings are the same). If no language (user locale) is selected, the system performs the comparison by using default values.
With a double-byte character set (DBCS) version of the system, this function can compare two DBCS strings.
The lstrcmp function uses a word sort, rather than a string sort. A word sort treats hyphens and apostrophes differently than it treats other symbols that are not alphanumeric, in order to ensure that words such as "coop" and "co-op" stay together within a sorted list. For a detailed discussion of word sorts and string sorts, see the Remarks section for the CompareString function.
Windows 95/98/Me: lstrcmpW is supported by the Microsoft Layer for Unicode. To use this, you must add certain files to your application, as outlined in Microsoft Layer for Unicode on Windows 95/98/Me Systems .
Example
For an example, see Determining the Location of a Share .
Function Information
Minimum DLL Versionkernel32.dll
HeaderDeclared in Winbase.h, include Windows.h
Import libraryKernel32.lib
Minimum operating systemsWindows 95, Windows NT 3.1
UnicodeImplemented as ANSI and Unicode versions.
See Also
Strings Overview , Collation , CompareString , CompareStringEx , CompareStringOrdinal , lstrcat , lstrcmpi , lstrcpy , lstrlen
==原始网址==http://msdn.microsoft.com/en-us/library/ms647488(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 9:18:26