0

I am trying to use a for loop to print the contents of a single dimensional array. I am trying to use the loop counter in the 'cout' statement to provide a heading for the contents of each array element. code is below. I am using MS Visual Studio to write and compile the code and I receive the following error when I compile:

"error C2065: 'forCounter' : undeclared identifier"

I am not sure what I am doing wrong. Please help.

for (int forCounter = 0; forCounter < wageArraySize; forCounter++ );
		cout << "Salary between $" << wageArray[ forCounter ] << "00 and $" << wageArray[ forCounter ] << "99: " << wageArray[ forCounter ] << endl;
2
Contributors
2
Replies
3
Views
9 Years
Discussion Span
Last Post by astockton
0

That fixed it, thank you for the help.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.