如何通过变量访问结构体成员

如何通过变量访问结构体成员,如代码:

struct j{
    int a,b,c,d,e;
}n[10]
int main(){
    char x[1]="/0";
    scanf("%c",&x[0]);
    //然后我想用x这个字符里的字符去访问j里的变量,比如x="a",那么就访问n[i].a,别用判断结构(if,case,switch)因为我要用链表
}

我本人穷的一匹,求
#大佬
帮助

#include<iostream>
using namespace std;
struct j {
    int arr[5] = {1,2,3,4,5};
}n[10];
int main() {
    char x = 'a';
    scanf("%c", &x);
    printf("%d", n[0].arr[x - 'a']);
    return 0;
}

#include<iostream>
#include<map>
using namespace std;
struct j {
    map<char, int> mp;
}n[10];
int main() {
    char x = 'a';
    scanf("%c", &x);
    printf("%d", n[0].mp[x]);
    return 0;
}

没理解你的思路,你最好把完整的想法说一下,感觉这种奇怪的操作跟链表没关系啊?
很可能有更好的办法解决。

用std::map容器,一个键对应一个值,根据键来搜索值