Due to the lack of reference parameters being available in C, i need to use pointers to change a value with a function, but I can't seem to figure out how I can pass an array to a function and change the array values, is there a thread somewhere which covers this? or can someone give me an example? thnx
EDIT: I believe I figured it out, someone correct me if I'm wrong plz
example:
Code:
#define elements 4
int somearray[elements];
void arraychanging(int* array[],int elements)
{
int counter = 0;
for(counter = 0;counter<elements;counter++){
*array[counter] = 1
}
}
arraychanging(&somearray,elements);