Mar 05, 2021, 08:53 PM

News:

Choose a design and let our professionals help you build a successful website   - ITAcumens



Post reply

The message has the following error or errors that must be corrected before continuing:
Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Note: this post will not display until it's been approved by a moderator.

Name:
Email:
Subject:
Message icon:
Verification:
Please leave this box empty:

Type the letters shown in the picture
Listen to the letters / Request another image

Type the letters shown in the picture:

shortcuts: alt+s submit/post or alt+p preview

Topic Summary

Posted by sukishan
 - Jul 13, 2009, 12:01 AM
The collection of string functions included in windows to calculate string length, copy string, concatenate strings and compare strings are listed below:

lstrcmpi - Compares two strings, ignoring case.

lstrcmp - Compares two strings.

lstrcpyn - Copies one string to another, with a maximum length.

lstrcpy - Copies one string to another.

lstrlen - Gets the length of a string in characters.


lstrcmpi
Compares two character strings. The comparison is not case sensitive.

Syntax

int lstrcmpi(LPSTR lpszString1,LPSTR lpszString2);

The first parameter lpszString1 is the pointer to the first null-terminated string to be compared. The second parameter lpszString2 is the pointer to the second null-terminated string to be compared. This function returns a negative value if the function succeeds and the string that lpszString1 points to is less than the string that lpszString2 points to. Returns a positive value if the string that lpszString1 points to is greater than the string that lpszString2 points to. Returns zero if the strings are equal. The lstrcmpi function compares two wide 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. Similarly two wide strings can be compared using the function lstrcmpiW and also the wide character string can be represented using LPCWSTR (long pointer to wide character string).


lstrcmp

Compares two strings. The comparison is case sensitive.

Syntax

int lstrcmp(LPSTR lpszString1,LPSTR lpszString2);

The first parameter lpszString1 is the Pointer to the first null-terminated wide string to be compared. The second parameter lpszString2 is the Pointer to the second null-terminated wide string to be compared. Returns a negative value if the function succeeds and the string that lpszString1 points to is less than the string that lpszString2 points to. Returns a positive value if the string that lpszString1 points to is greater than the string that lpszString2 points to. This function returns zero if the strings are equal. 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. Similarly two wide strings can be compared ignoring case using the function lstrcmpW.


lstrcpy

Copies a string to a buffer.

Syntax

LPSTR lstrcpy(LPSTR lpszString1,LPSTR lpszString2);

The first parameter lpszString1 is the Pointer to a buffer to receive the contents of the string pointed to by the lpszString2 parameter. The buffer must be large enough to contain the string, including the terminating wide null character. The second parameter lpszString2 is the pointer to the null-terminated wide string to be copied. This function returns a pointer to the buffer. Similarly two wide strings can be copied using the function lstrcpyW.


lstrcpyn
Copies a string to a buffer, up to a specified number of characters.

Syntax

LPSTR lstrcpyn(LPSTR lpszString1,LPSTR lpszString2,int iMaxLength);

The first parameter lpszString1 is the pointer to a buffer to receive the contents of the string that the lpszString2 parameter points to. The buffer must be large enough to contain the string, including the terminating wide null character. The second parameter lpszString2 is the pointer to the null-terminated string to be copied. The third parameter iMaxLength gives the maximum number of characters to copy, including a terminating null character. This function returns a pointer to the buffer. If iMaxLength is nonzero, lstrcpyn always inserts a terminating null character in the destination string, which could result in the source string being truncated. Similarly lstrcpynW copies a wide string to a buffer, up to a specified number of wide characters.


lstrlen

Retrieves the length of the specified string.

Syntax

int lstrlen(LPSTR lpszString);

The first parameter lpszString is the pointer to a null-terminated wide string. If the function succeeds, the return value specifies the length of the string. Similarly lstrlenW retrieves the length of the specified wide string.
IT Acumens Web Designing Chennai | GinGly :: Build your Personal Website | CineBuzz :: Cinema News | My Kids Diary :: Gift your Kids Memories :: Book Website @ 349 Rs monthly
Copyright 2005 - 2021 :: IT Acumens :: All Rights Reserved. :: XML Sitemap
ITAcumens Discussion Forum with 2 lakhs post running for 15 years - Powered by IT Acumens Pro Dedicated Server

My Kids Diary