Accessing items of an array by index

Suppose I use a item of an array inside a loop, like INS *in; for (int i = 0; i < LEN; i++) { in = g_ins[i]; if (strcmp(in->mne, str) == 0) return in; } If i refer each reference using the index, this is optimized by the compiler to something like above, or it really access each index again and again? for (int i = 0; i < LEN; i++) { if (strcmp(g_ins[i]->mne, str) == 0) return g_ins[i]; }

以上就是Accessing items of an array by index的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » CSS3 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准