#include <iostream>
using namespace std;
int main(){
// 初始化 char **
char *temp[2] = {"Raptors", "Warriors"};
char **x = temp;
// 遍历 char**
for(int i = 0; x && x[i]; i++){
cout << x[i] << '\n';
}
}
参考:https://bbs.youkuaiyun.com/topics/330028075

本文演示了如何在C++中使用指针数组来存储和遍历字符串数组。通过实例代码,展示了char**类型的变量初始化及遍历过程。
822

被折叠的 条评论
为什么被折叠?



