#include <iostream> int a[] = {1, 12, 2, 8}; int b[] = {23, 11, 2, 3}; int main() { int ind = 3; int c = ind[b][a]; int d = 2[a][b]; cout << "c = " << c << std::endl <<"d = " << d; return 0; }The Magic here is that the arrays are evaluated and indexed from left to right using integer variables or intrinsic integers.
c = 8
d = 2
No comments:
Post a Comment