This is a great exercise to do if you are just starting to get familiar in working with arrays, good on you! This is how I would implement a program that would accept user input into an array, and then print each element in the array (be sure to read the comments!):
#include <iostream>
using namespace std;
const int MAXSIZE = 3;
void Memory(){
//initialize array to MAXSIZE (3).
int Mange[MAXSIZE];
//iterate through array for MAXSIZE amount of times. Each iteration accepts user input.
for(int i = 0; i < MAXSIZE; i++){
std::cin >> Mange[i];
}
//iterate through array for MAXSIZE amount of times. Each iteration prints each element in the array to console.
for(int j = 0; j < MAXSIZE; j++){
std::cout << Mange[j] << std::endl;
}
}
int main() {
Memory();
return 0;
}
I hope this helps! A great way to learn about what this program is actually doing is to copy and paste this into an IDE and then run a debugger on the code and observe what happens line by line.