View Single Post
Old 09-10-2015, 11:31 AM   #2
AutotelicBrown
Under the scarlet moon
FFR Simfile AuthorD7 Elite KeysmasherFFR Veteran
 
AutotelicBrown's Avatar
 
Join Date: Jan 2014
Age: 27
Posts: 867
Default Re: [University - C++ Programming] Filling an Array with RNG & Display Contents

Your current code doesn't make any sense. The first time you pass through the "for" block the statement "return 0" will be called and finish your program, the function Display should be defined outside of the main block and the global definition of randArray and i are "shadowed" by the new (and independent) re-definitions inside the main block.

I'm assuming you missed my last post in your other topic, you should definitely check the tutorial with all the language basic constructs and what they actually mean. The answer to your first error is there too.

For the second error (that is actually a question), I'll point you to this. I'm assuming you understand functions, how pointers work and that you can reference arrays as pointers (if you don't, refer to the tutorial in the other post).
AutotelicBrown is offline   Reply With Quote