> For the complete documentation index, see [llms.txt](https://malwaresourcecode.com/home/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://malwaresourcecode.com/home/markdown/wchar-to-char/shlwapiwchartochar.md).

# ShlwapiWcharToChar

```cpp
#include <Windows.h>
#include <Shlwapi.h>

#pragma comment(lib, "Shlwapi.lib")

INT ShlwapiWCharStringToCharString(PWCHAR InString, PCHAR OutString, INT BufferSize)
{
	return SHUnicodeToAnsi(InString, OutString, BufferSize);
}

INT main(VOID)
{
	WCHAR String1[] = L"I like cats a lot";
	CHAR String2[256] = { 0 };
	SIZE_T Length = 0;

	Length = ShlwapiWCharStringToCharString(String1, String2, 256);

  return ERROR_SUCCESS;
}
```
