> 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/chararraytobytearray.md).

# CharArrayToByteArray

```cpp
VOID CharArrayToByteArrayA(_In_ PCHAR Char, _Inout_ PBYTE Byte, _In_ DWORD Length)
{
	for (DWORD dwX = 0; dwX < Length; dwX++)
		Byte[dwX] = (BYTE)Char[dwX];
}

VOID CharArrayToByteArrayW(_In_ PWCHAR Char, _Inout_ PBYTE Byte, _In_ DWORD Length)
{
	for (DWORD dwX = 0; dwX < Length; dwX++)
		Byte[dwX] = (BYTE)Char[dwX];
}
```
