KL wrote:
I have the following function:
void fillvaluecheck (int valuecheck[], int size){
for (int m = 0; m < size; m++){
cout << valuecheck[m] << endl;
valuecheck[m] = 0;
cout << valuecheck[m] << endl;
}
return;
}
I have the two cout statements only to verify that the function was
working correctly. Well, it is not doing anything that I can tell. I
want to fill my valuecheck array with all zeros. What am I possibly
doing wrong?
KL
KL,
Your function itself looks fine. Look at the following code and see if
it helps at all.
$ cat test.cpp
#include <iostream>
using namespace std;
void fillvaluecheck(int valuecheck[], int size) {
for(int m = 0; m < size; m++) {
cout << valuecheck[m] << endl;
valuecheck[m] = 0;
cout << valuecheck[m] << endl;
}
}
int main() {
int valuecheck[10];
fillvaluecheck(valuecheck, 10);
return 0;
}
ken@ken-wn0vf73qmks ~/c
$ ./test
-1
0
2088773120
0
2088772930
0
2089866642
0
2088803259
0
1896
0
2289608
0
1628013867
0
1896
0
-1
0