C++ 二重指针小例子

2019-04-01  本文已影响0人  cb_guo
#include<iostream>
#include<string.h>
using namespace std;

void fab(const char **words){
    for(int i=0; i < 4; i++){
        // cout<<strlen(*(words + i))<<endl;
        for(int j = 0; j < strlen(*(words + i)); j++){
            cout<<*(*(words + i) + j)<<" ";
        }
        cout<<endl;
    }
}

int main(){
    const char *words[10] = {"apple", "banana", "orange", "red"};
   
    fab(words);
}
上一篇 下一篇

猜你喜欢

热点阅读