int a[5]= { 1, 2, 3 ,4 , 5};
char letter;
cin >> letter;
If I input a, which is the name of my array, is it possible to retrieve a value from array a by using letter as the array name instead of a. Ex: letter[0] = 1.
int a[5]= { 1, 2, 3 ,4 , 5};
char letter;
cin >> letter;
If I input a, which is the name of my array, is it possible to retrieve a value from array a by using letter as the array name instead of a. Ex: letter[0] = 1.
No, it is not supported by design.
If you are keen to go ahead, you might consider to use a std::map
.