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 myArray
into pointer to pointer to char .
Any suggestions of how I can achieve this.
manaila
0
Light Poster
Recommended Answers
Jump to PostThis 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.
All 4 Replies
Gribouillis
1,391
Programming Explorer
Team Colleague
manaila
0
Light Poster
Gribouillis
1,391
Programming Explorer
Team Colleague
jacks009
-10
Junior Poster in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.