1 用C-style 来访问vector

1
2
3
4
5
6
7
8
  vector<char*> str;
   str.push_back("abc");
   str.push_back("123");

   //按照 C-style 来访问vector
   char** ptr= str.data();
   for(int i =0;i<2;++i)
    printf("%s\n",ptr[i]);