Array Index variables

To add comments, please log in or register
ajola
35
ajola  

Can an array accept a struct element as an index

For instance Array[Struct.element];

thanks

whroeder1
17943
whroeder1  
  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.
To add comments, please log in or register