Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Retuning a String

Status
Not open for further replies.

bashet

Programmer
Mar 5, 2002
6
IN
Hi,
i am stuck in a project with this problem.
i have string with i am printing on console with
printf("%ls",str);
i also want to compare with another string using strcmp which is not happening.
if i give on %s instead of %ls its returning a character to the console

what the problem with %ls
so what is %ls i am wondering
 
%s is string, %ls is Wide-character string functions
 
Hi,
First of all thanx for the reply
Now i want to compare that wide character string with a normal String which is not happening.

Any inputs for it will be really handy

Thanx again
 
You'll need to

(1) convert both to multi-byte strings, or
(2) convert both to wide character strings

if you want to compare them to each other. You can accomplish this with mbstowcs() and/or wcstombs(). Jon Sagara
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top