Click here to Skip to main content
15,894,896 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I used an array counter as Count[15] = 0. I want to increment the counter for the particular index like Count[10]++. Is this valid statement or not? Or any other way to do same thing.
Posted

Yes. It's a valid statement.

 
Share this answer
 
Of course it is valid.
An alternative would be
C++
Count[10] = Count[10] + 1;
 
Share this answer
 
by doing this change I got following error:

error C2440: 'initializing' : cannot convert from 'const int' to 'int [18]'

I defined the count variable as "static int Count[MAX_STATION_NO+2] = 0;"
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900