In Objective-C, one can pass an array to a function easily be reference and allow the array values to be changed by the function. This seems to be very difficult to do in Swift. I have a fixed length array which I am passing to a function whose header is:
func rho33(.... inout inten: [Float]...)
In the calling program, I use:
rho33(...inten: &inten...) to pass the array, "inten". Swift requires the local value of the passed array to be also in the calling statement, followed by a colon. I allocated enough memory for inten using: "inten.reserveCapacity(400)" (in the calling program). When I single stepped through the program, whenever it accessed "inten" in the function, I got an "index out of bounds" error (I also reserved the memory in the func and this didn't help). Is there a good reference to this business of passing arrays (a fairly elementary and useful procedure in all the C dialects)? Thanks!
Warren Nagourney