Could anyone help me in understanding why the below code is not freeing the memory after it is being allocated.
BSTR ys;
{
ys = ::SysAllocString(L"Asdfghjk");
{
::SysFreeString(ys);
}
}
wcout << ys; // *I could see "Asdfghjk" in console window*