first of all sorry for not posting properly since i am first time user. I just want to convert the below code into C from C++ vector. I tried to use structure and calloc or malloc but didn't work.

************************************************** **************
Code:
unsigned int current_context = sim_cycle % cores[core_num].context_ids.size();
 int disp_context_id = cores[core_num].context_ids[current_context]; /* the ID of the context currently being examined */
 std::vector<int> contexts_left(cores[core_num].context_ids);
 
disp_context_id = contexts_left[current_context];
  if(contexts[disp_context_id].ROB_num == 0)
  {
   //if there are no more instructions waiting dispatch for this thread, try another thread
   contexts_left.erase(contexts_left.begin()+current_context);
   if(contexts_left.empty())
    break;
   current_context%=contexts_left.size();
   continue;
  }