#include <string.h>
#include <stdio.h>
#include <wchar.h>

int main(void) {
	size_t      sizeOfCovertion = 0;
	mbstate_t   mbstate;
	char        mbStr = 0;
	wchar_t*    wcStr = L"Q";

	memset(&mbstate, 0, sizeof(mbstate));
	sizeOfCovertion = wcrtomb(&mbStr, *wcStr, &mbstate); // C4996
	
	if (sizeOfCovertion > 0) {
		printf("The corresponding wide character \"");
		wprintf(L"%s\"", wcStr);
		printf(" was converted to the \"%c\" ", mbStr);
		printf("multibyte character.\n");
	} else {
		printf("No corresponding multibyte character was found.\n");
	}
}
