I am calling a function which outputs a wide character in the output stream. Consider:-
wcout<<GetOutput();
and the definition of function is like this:-
const wchar_t* GetOutput()
{
std::wstringstream stringStream;
stringStream << out_name << " " << out_type << out_subtype;
wchar_t* check = new wchar_t[stringStream.str().length() + 1];
wcscpy(check, stringStream.str().c_str());
return check;
}
Now, when this functions is called on cmd, it is giving me correct output. But, when the same function is called on linux(WSL), I am getting output as an address which is something like this:-
0x1ef110ad0
Why is this happening?
Edit:- The definition of variables are as follows:-
const std::wstring out_name = L"My Name";
const std::wstring out_type = L"Type1";
const std::wstring out_subtype = L"SubType1";