i was looking at some sample code and i noticed something odd about the way someone used an array
he declared it like a normal array:
int a[10]={0};
then he did this:
a[3]++;
any explanation as to what this does would be great and if you could link me to a site that may give an in depth explanation would be most appreciated.
C++ array question
Started by PeaceFrogs, Nov 21 2009 02:21 PM
2 replies to this topic
#1
Posted 21 November 2009 - 02:21 PM
|
|
|
#2
Posted 21 November 2009 - 03:31 PM
All 10 elements of the array were initialized to zero.
Then element a[3] was incremented.
http://web.archive.o...ft.html#3.3.2.4
Then element a[3] was incremented.
http://web.archive.o...ft.html#3.3.2.4
#3
Posted 21 November 2009 - 03:50 PM
haha i feel dumb now. thank you for your quick response :)


Sign In
Create Account

Back to top









