Hello. I am new to C++ and I am having difficulty with arrays. When I ask the program to print out the array of numbers that were inputted, the program would always output a 0. Now, if I set the program to output the array in the for loop, it will work out fine. Can someone explain this to me as to why it does that? Also, let's say I want to use the numbers inputted for something else (maybe use it in another function or algorithm, etc). Do I have to put those functions or algorithms in the for loop as well to use the inputted numbers? Thanks!
count is equal to 10. So you are trying to output element array[10] that does not exist. So some arbitrary value that is in the memory outside the array is outputed.