Maybe I have forgotten something that's easy to do or not, but I am having trouble getting one of my functions to work. Basically I am creating an array of 8 values. I am then passing that array, the size, and one more parameter to second function. That second function proceeds to recurse itself, whiles at each recursive call inserts a new value into the array -- it presently doesn't return anything. I want to change the original array values. Are you following me? However, the original array nevers changes. So, I did some reading and I found out when you pass something to a function it justs creates a copy in that new function. I need to know how to pass an array and change the original values of that array in the new function. Is it possible?
Just in case your want to know what I am doing...I am working with a tree to generate a pre-order traversal. I need each node in the tree to be inserted into an array in that order. That's why the second function is a recursive function. I am starting with the root node and working my way through the tree's descendants.
Please help, because I don't know what else to do. Thanks.
Just in case your want to know what I am doing...I am working with a tree to generate a pre-order traversal. I need each node in the tree to be inserted into an array in that order. That's why the second function is a recursive function. I am starting with the root node and working my way through the tree's descendants.
Please help, because I don't know what else to do. Thanks.