typedef struct _ut_slot {
ucontext_t uc;
....
}*ut_slot;
static ut_slot* table; //array of the structs
void foo (int tab_size){
table = malloc ( tab_size *(sizeof (ut_slot))); // memory allocation for array of structs
for(i = 0 ; i < tab_size ; i++ ){
getcontext(&table[i].uc); <--- ??????
}
}
我在“getcontext”字符串中收到错误。如何编写对数组任何元素的引用?以及如何使用“getcontext”命令初始化每个数组元素的“uc”字段?