Code:
void eMath::GetIndex()
{
for(int i=0;i<MAX_SIZE;i++)
{
if(eNumber[i]== 'I' )
Counter[0]++;
if(eNumber2[i]== 'I' )
Counter[0]++;
if(eNumber[i]== 'N' )
Counter[1]++;
if(eNumber2[i]== 'N' )
Counter[1]++;
if(eNumber[i]=='9')
Counter[2]++;
if(eNumber2[i]=='9')
Counter[2]++;
if(eNumber[i]=='L')
Counter[3]++;
if(eNumber2[i]=='L')
Counter[3]++;
if(eNumber[i]=='/')
Counter[4]++;
if(eNumber2[i]=='/')
Counter[4]++;
if(eNumber[i]=='O')
Counter[5]++;
if(eNumber2[i]=='O')
Counter[5]++;
if(eNumber[i]=='Y')
Counter[6]++;
if(eNumber2[i]=='Y')
Counter[6]++;
}
}
So i got this huge loop going through 2 arrays eNumber and eNumber2..i then store the amount of characters from each into one counter. The reason i'm doing this it's because it's supposed to add the characters together. so example if i input "III" and "III"
the output should be "IIIIII." The only problem i'm having is getting the output done with the counter. I've made an array with all the characters
Code:
const char EG_NUMBERS[]={'I','N','9','L','/','O','Y'};
So now i want to integrate the counter with this array. I'm having a hard time implementing it. I need it so that EG_NUMBERS outputs IIIIII, when it counts 6 "I"s. Sorry if my grammer is bad.
EDIT:
I was thinking of something along these lines. But K<length? of the counter?
Code:
for(int k=0;k<;k++)
cout<<EG_NUMBERS[Counter[k]]<<endl;