What is the difference between char *p and char p[] in two below code:
#include<stdio.h>
#include<string.h>
void main()
{
char source[]="stackflow";
char target[0];
strcpy(target,source);
printf("%s", target);
}
#include<stdio.h>
#include<string.h>
void main()
{
char source[]="stackflow";
char *target;
strcpy(target,source);
printf("%s", target);
}
Why is the former working while the letter not?