What is the index type of an associative array declared as array_name[*] ?
What is the index type of an associative array declared as array_name[*] ?
Model answer
[*] declares an associative array with a wildcard index type. It can be indexed by an integral expression of any width. The index is an integral value, and elements are ordered numerically. Non-integral types such as real are not allowed as an index. An index containing x or z is invalid. A string literal used as an index is treated as an equivalent bit vector. Wildcard arrays have restrictions: they cannot be used in a foreach loop or with array methods that return an index, such as find_index . For these, declare a specific index type, such as int data[string] .