i have written a code . this looks as follows .
#include<stdio.h>
#include<string.h>
int do_print2(char *q[]);
int main()
{
char *p[]={"pointervaule","NAM", "JAM", "CALM"};
do_print2(p);
return 1;
}
int do_print2(char *p[])
{
printf("this is print1 char *p \n");
strcat(p[0],"added");
printf("%s\n", (p[0]));
return 1;
}
after compilation, i am trying to run it, i am getting segmentation fault. help me in learning what is the reason for that error. thank in advance.