unw*_*ind 16
#include <string>
std::string my_strings[100];
Run Code Online (Sandbox Code Playgroud)
那就是C++,使用STL.在C中,你会这样做:
char * my_strings[100];
Run Code Online (Sandbox Code Playgroud)
这读作"我的字符串是100个指向char的指针的数组",后者是字符串在C中的表示方式.
sou*_*rge 13
我宁愿建议在几乎所有情况下都使用字符串向量:
#include <string>
#include <vector>
std::vector<std::string> strings;
Run Code Online (Sandbox Code Playgroud)