#include<stdio.h>
int main(){
char *p[2];
char *q[2];
char *a = "Hello";
char *b = "world";
p[0] = a;
p[1] = b;
*q = *p;
printf("\n %s \n",q[0]);
printf("\n %s \n",q[1]);
return 0;
}
I wanted to store the pointers stored in the p to q. when tried to print q[1], i'm getting a junk value. But q[0] prints "Hello" correctly.