Converting array of pointers to double pointer

后端 未结 3 1504
别跟我提以往
别跟我提以往 2021-01-27 09:51

I am able to do this:

char * months[] = {\"empty\",\"jan\",\"feb\",\"mar\",\"apr\",\"may\",\"jun\",\"jul\",\"aug\",\"sep\",\"oct\",\"nov\",\"dec\"};

unsigned sh         


        
3条回答
  •  闹比i
    闹比i (楼主)
    2021-01-27 10:23

    Here is a way to assign array of pointers to double pointer, I hope this is what you are looking for:

    #include
    
    int main()
    { 
        char *arr[]={"hello","world"};
        char **ptr=arr;
    
        printf("%s\n",ptr[1]);
        return 0;
    }
    

    OUTPUT: world

提交回复
热议问题