The below code outputs a segmentation fault :11
#include<stdio.h>
#include<string.h>
int main(){
char **total;
strcpy(*(total+1),"hello");
printf("%s",*(total+1));
}
But while the below one(when initialised without **Array)
#include<stdio.h>
#include<string.h>
int main(){
char total[3][100];
strcpy(total[1],"hello");
printf("%s",total[1]);
}
So what exactly went wrong in the first code? Is it due to the initialisation step or the strcpy function?