#include <wchar.h>
|
|
wchar_t
wcsdup (const wchar_t *wcs); |
If insufficient memory is available, NULL is returned and errno is set to ENOMEM.
#include <wchar.h>
/* Illustrates how to use wcsdup API */
int example_wcsdup(void)
{
/* input string for which length has to be found */
wchar_t *srcws=L"testwcsdup";
wchar_t *destws = NULL;
/* invoke the API wcsdup to duplicate the string */
destws = wcsdup(srcws);
/* return no error if src str and dest str are equal else return an error */
if(!(wcscmp(srcws,destws)))
{
free(destws);
return 1;
}
else
{
free(destws);
return -1;
}
}
|
© 2007-2009 Nokia Corporation. All rights reserved. This documentation can be used in the connection with this Product to help and support the user. |
|