我想做以下事情:
typedef enum {a, b, c} my_type_e;
typedef enum {receive, transmit} dir_e;
class my_class #(type my_type_e);
my_type_e variable_name;
endclass
但我想使用dir_e作为索引使“variable_name”成为一个数组 . 例如
my_class class_h;
class_h.variable_name[rx] = a;
要么
my_class class_h;
class_h.variable_name[tx] = c;
那有意义吗?
1 回答
您想声明一个关联数组 .