ITPub博客

首页 > > > 字符数组优雅遍历

字符数组优雅遍历

作者:友哥 时间:2018-08-31 14:57:00 0 删除 编辑
#include <iostream>

int main(){
  const char *options[] = { "test1", "test2", "test1", "test2", NULL };
  int i = 0;
  while(options[i]){
    std::cout<<options[i]<<std::endl;
    i++;
  }

  return 0;

}

 

原文作者:;如有侵权,请联系管理员删除。

请登录后发表评论 登录
全部评论

注册时间:2020-05-20

  • 博文量
    276
  • 访问量
    1000