0
Explain
a[a[2]]
5 Answers
+ 4
Ajith your posted lines of code have many problems like first a is not declared so instead of x you have to use a than which elements you will aceess is out of bound like this way
a[2]=3
a[a[2]= a[3] = garbage value as length of array is 3 and you are accessing 4th element of array which resulted in garbage value.
+ 2
Example
a=[1, 2,0]
a[2] = 0
a[a[2]]=a[0]=1
+ 2
will make an IndexOutOfBoundError because a[2]=3 and max Index is 2.
0
int x[3]={1,2,3};
Printf("%d"a[a[2]]);
0
Thank you guys