An array is out of bound crash

you are using the bracket operator [] to set the new values in the arrays T…NFW defined inside your function,

but I don’t see any memory allocation or size definition before…