jeudi 10 juin 2021

On windows “retsize <= sizeInWords” in mbstowcs

I am getting the error “retsize <= sizeInWords” in mbstowcs. Can someone please guide me as to where am I making mistake.

const char *pChar = "[{\]}] ";
int len = strlen(pChar);
wchar_t *str = (wchar_t*)calloc(len+1, sizeof(wchar_t));    // L"";
size_t cSize = len + 1;

mbstowcs_s(&cSize, str, cSize+1, pChar, cSize);

Aucun commentaire:

Enregistrer un commentaire