Well I'm totally not getting this, anyone care to help. I'm trying to show an array passing to a function and I also need to include conts with array parameter. I'm missing the function prototype also.
Also if you feel like giving me hand with C++ programming, drop me a PM, since I'm totally lost at the moment with my classes.
Code:
#include <iostream.h>
void changeElement(int a[], int n) {
for (int i = 0; i < n; i++) {
a[i] *= 2;
}
}
int main() {
int list[] = { 0, 1, 2, 3 };
changeElements(list, 4);
for (int i = 0; i < 4, i++) {
cout << list[i] << endl;
}
return 0;
}
0
2
4
6

Comment