private void testFunc()
{
int[] arrayParam = new int[88];
arrayParam[2] = 67;
calledFunc(arrayParam);
Console.WriteLine("testFunc Done");
}
private void calledFunc(int[] intArray)
{
Console.WriteLine(intArray[2]);
//if new array declared, values not changed in testFunc
intArray = new int[66];
intArray[2] = 33;
intArray[5] = 55;
}
If calledFunc simply changes array values, the changes are passed back to the calling method. But if calledFunc allocates a new array, this is not passed back to the caller. How do I get a called method to have the ability to either change existing array elements, or pass back a new array and its new values?