I've seen a piece of code that goes like this:
int charP[] = {
['A'] = 1,
['B'] = 2,
['C'] = 3,
['D'] = 4};
My syntax highlighter for C++ does not recognize it, but the syntax highlighter for C does. It sort of behaves like a Python dictionary, so charP['A']
would spit out 1
. Maybe I'm not looking hard enough, but can anyone point me in the right direction because every time I search "C++ dictionary" or "C dictionary", it always involves Maps and not this. What is it? What are its limitations?