#include <iostream>
#include <iomanip>
usingnamespace std;
void invoer(constint a[], int lengte);
int main(){
int AANTAL;
cout << "How many numbers you want to add:";
cin >> AANTAL;
int cijfers1[AANTAL];
invoer(cijfers1, AANTAL);
}
void invoer(constint a[], intconst lengte){
for (int i=0; i<lengte; i++){
cout << i+1 << "st number is :";
cin = a[i];
}
cin.get();
}
if you want to help me, can you write it in simple English and use the terms that are close to my C++ syntax. I have only see the basics of C++ till pointers ans arrays. But I think that the idea is do this without using pointers.
Also though line 14 will probably work, it still non-standard and should be avoided. Use vectors or if you absolutely need to use arrays, use int* cijfers1 = newint[AANTAL]; and add delete cijfers1; at the end of main()
The aim of the code was to fill the array with numbers through a function.
Smac89, you where right. I made from the Array an Const int.. Thats why I couldn't store numbers in it. Thanks a lot all, for helping me solve this little problem.