Hi All,
The program I am writing is throwing up an error when it runs on this line
runArray[counter]++;
i am trying to increment the number at location counter in the array.
Is this the correct way to do this?
Thanks
Hi All,
The program I am writing is throwing up an error when it runs on this line
runArray[counter]++;
i am trying to increment the number at location counter in the array.
Is this the correct way to do this?
Thanks
post the error message. and more of the code
Yep, it looks perfect to me -- at least what you posted is perfect.
Hi All,
The program I am writing is throwing up an error when it runs on this line
runArray[counter]++;
i am trying to increment the number at location counter in the array.
Is this the correct way to do this?
Thanks
The above line is invalid if the array is defined as constant.
const int runArray [6] = { 1, 2, 3, 4, 5, 6 } ;
int counter = 0 ;
runArray [counter] ++ ; // error - can't modify read only location
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.