Return array from function, then pass it to another. Also - array delete question
I'm having trouble getting this started.
I need main to call a function that returns a 62 byte array.
I then need that array to be passed to another function that will verify the data for use and pass a 1 back to main or reject the data and return an error of some sort so main knows to try again.
I can handle the if else stuff in main - it's the returning the array part I'm having trouble getting straight. I get that it should be a pointer reference and I can manage reference passing/returning with variables, but this isn't so clear to me.
2nd question on deleting - if I declare and initialize an array - lets call it
Code:
someFunction()
myArray[62] = {1}
and then return it's value and then keep coming back to somefunction() without ever having used "delete myArray" - does it create a new array (ie - occupy another memory chunk) every loop and will eventually crash, even though the name is the same? Or will it overwrite the original myArray[] and I don't have to worry about deleting?
Thanks