Code:
for (counter = 0 ; counter < strlen(data[i].groupCode) ; i++)
{
x = data2[i].groupCalc * i;
sum = sum + x;
}
First you should make up your mind which string you are operating on... You are using the length of one string to control a loop operating on a different string altogether.
Second... do you want to multiply the ascii value of the digits or the numerical value represented by the digits?
What you appear to want is this...
Code:
int MultiplyString(char *str, int mul)
{ int sum = 0;
int x;
int y = strlen(str);
for (x = 0; x < y; x++)
{ sum += (str[x] -'0') * mul; }
return sum; }