I'm trying to pass an array from one function to another without resorting to pointers and I have to use Pass by Reference. I can't seem to figure it out. I've been looking at many examples and just don't get it.
the function createAbc makes an array populated with the Alphabet. I need to pass that into my display function so that i can work with the array there. I don't know how to pass it in there... :(
It is defined on my computer. But since the actual code of Display doesn't seem relevant I decided to exclude it atm. I still can't figure out how to pass the contents of the array in creatAbc function into display function so that I can do stuff to the array from creatAbc in display function.
OMG, wow. So apparently it just works as long as you maintain this order.
I did not know that...
Doing it that way, my display function randomly selects letters from the alphabet now. Now I just need to figure out how to use tolower properlly so that I can have random lower case and capital letters.
Ok I thought I understood what was going on. Except now when I'm trying to pass my counter array to display the count in another function it does not work the same way as it did above? Counter[i] is all zeros? Even though counter in Display function is assigned a value.
EDIT: Think I realize what I was doing wrong... I forgot to declare the array's scope per function and not just in one function.