CProgramming11
No, I don't believe that will work because i is changing inside the the for loop, within the function. Therefore the value in not pre determine until it's inside the functions for-loop.
Code:
function (int aIn[], int aOut[]){
int i, j;
int index=0;
for(j=0; j<=9; j++){
for(i=0;i<ARRAY_SIZE;i++){
if((aIn[i]%10) == j){
aOut[index] = aIn[i];
index++;
}
}
}
}
right where aIn[i]%10 is used, I want to be able to change that each time I call this function, aIn[i]%10, aIn[i]/10)%10, aIn[i]/100)%10, respectively. So, I was thinking that assigning ex.
Code:
char *input = "aIn[i]%10";
function(input, aR, sR);
Does that help?