navigaid
2/22/2017 - 7:01 PM

function returning reference http://mathematica.stackexchange.com/questions/34850/is-there-anything-like-a-c-pointer-or-returning-a-referenc

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}