function returning reference http://mathematica.stackexchange.com/questions/34850/is-there-anything-like-a-c-pointer-or-returning-a-reference-in-mathematica
int array[7] = {0, 0, 0, 0, 0, 0, 0};
int& foo(size_t idx)
{
return array[idx];
}
foo(4) = 43;
// array should now be {0, 0, 0, 0, 43, 0, 0}