获取数组长度遍历数组:
#include
usingnamespace std;
int main()
{
char* x[5]={(char*)"1",(char*)"2",(char*)"3",(char*)"4","5"};
for(int i =0; i <sizeof(x)/sizeof(char*); i++){
cout << x[i]<<"\n";
}
}
获取数组长度遍历数组:
#include
usingnamespace std;
int main()
{
char* x[5]={(char*)"1",(char*)"2",(char*)"3",(char*)"4","5"};
for(int i =0; i <sizeof(x)/sizeof(char*); i++){
cout << x[i]<<"\n";
}
}