Beginner question? Function or goto?

I am writing a program that needs to use arduino to make a map of a network (sequential logic network). My current approach for this is uses 4 matrices (multidimensional arrays) and one number to keep track of this. I haven't written the code yet and I'm making a flowchart for this and some of the functions need to modify these matrices (make the map keep track of progress, see what input combinations have been tried ect.) the issue I'm having is that I don't know if I can get a function to return the modified values of these matrices and the number so that I can store these for later. The only way I can think to make this work is to use the goto command instead of a function, but I've heard that's a bad idea... Is there a way I can have one function take several matrices as an input, modify them and return them to my program? Please keep in mind Im not very good at programming! Thanks!

In practice a goto is almost never required, but if that makes it the most clear to you there is no problem. I hope these matrices are not too big, the Arduino is very RAM limited.

I'm doing it on arduino to make sure the algorithm works so I'm gonna write it on arduino to solve a machine with like 3 flip-flops (8 states) and 2 or 3 input variables (4 or 8 combinations) so they'll be 4 8x8 matrices. These will all store ints or Bools aswell.

Goto has a bad rap but it can be appropriate at times.

the issue I'm having is that I don't know if I can get a function to return the modified values of these matrices and the number so that I can store these for later. The only way I can think to make this work is to use the goto command instead of a function

I don't get this, why couldn't a function return a value? If if you need to "return" the entire matrix you make the matrix global or pass a pointer to it to the function.

Either way you work on the matrix wherever it is, no need to pass it around.


Rob