0
我想寫這種東西:如何在運行時用持有者替換char變量?
(s[i])[i] ,where s[i] is of type char[].
例子:
s[i]="PDGH";
for(i = 0 ; i < strlen(someNumber) ; i=i+3)
(s[i])[formula]++; // on compile if s[i]='P', then i want to get P[formula]++ .
也許隨着字典? –
'strlen(someNumber)'? 'formula'?我一點也不清楚你想達到什麼。 –
我希望我的代碼用s [i]代替它的值來編譯,比如我有4個向量:int A [100],B [100],C [100] .D [100],我可以做s [i])[number],其中s [i]只能得到值A,B,C,D(這就是輸入被解析的方式),所以最終它就像是寫A [number]或B [數字]等,而不用明確地寫出名字A [數字],B [數字]等。 – user5731286