I'm programming game server and it uses unicode since I'm in Korea. The problem is that I can't copy wchar string from packet.
I checked wcsncpy_s(chat, 100, inChat.c_str(), inChat.length());
this works fine but something like this doesn't work.
wchar_t strId[10]; // I'm trying to copy L"player11" here.
wcsncpy_s(
strId,
10,
(WCHAR*)(buffer[2]), // buffer[0] : packet size, buffer[1] : packet type
9
);
I checked so many times to figure out what I've done wrong but I have no idea what is wrong about it.
It throws the same exception every time.
Exception thrown at 0x00007FFF20DFE5A0 (ucrtbased.dll) in SimplestMMORPG-Server.exe: 0xC0000005: Access violation reading location 0x0000000000000070.
Please help me...