Array Index variables

 

Can an array accept a struct element as an index

For instance Array[Struct.element];

thanks

 
  1. Your question is without context. We can't know what type element is.
  2. If element is (or convertible to) an int, then your code is equivalent to
    int index = Struct.element;
    Array[index];
    Which is "accept"able, of course.
Reason: