I have a map like so:
std::map<LPCWSTR, LPCWSTR> myMap = {
{L"key1", L"value1"},
{L"key2", L"value2"}
};
And I need to get the value from a variable of type const wchar_t *
that will match in value with the key.
I tried
const wchar_t * key = L"key1";
wchar_t VALUE[350] = myMap[key];
but it tells me "initialization with '{...}' expected for aggregate object"
I also tried
wchar_t VALUE[350] = myMap.find(key)->second;
and I get the same build error
In addition, I am adding this VALUE
to another wchar_t
using wcscat_s
which is why I don't have too much leeway with variable types.
I'm pretty sure my map is set up correctly, so how can I get the value from a key?