I have been struggling with this for two days now, with no luck. I have a C char array char myArray[] = "Hello World";
I also have a pointer to pointer to char char **ptr;
So I want to somehow store myArray to ptr or somehow convert myArrayinto pointer to pointer to char .
Any suggestions of how I can achieve this.

Thanks Gribouillis, I tried that but the below program fails at line 10:

#include <stdio.h>
#include <string.h>

int main(int argc, char **argv) {
    char ar[200] = "Hello World";
    strcat(ar, " !");
    printf("%s\n", ar);

    char **p = &ar;
    printf("%s\n", *p[0]);

    return 0;
}

This one works

#include <stdio.h>
#include <string.h>

int main(int argc, char **argv) {
    char ar[200] = "Hello World";
    strcat(ar, " !");
    printf("%s\n", ar);

    char* q = ar;
    char **p = &q;
    printf("%s\n", *p);

    return 0;
}

note that I'm only an occasional C programmer.

Edited 6 Months Ago by Gribouillis

This question has already been answered. Start a new discussion instead.