The difference is that in the first case, the size of str is specified as a string, and the second is not.
No. In the first program, the following statement
char *str[80];
defines stras an array of pointers 80for characters. You need an array of characters -
char str[80];
In the second program
char *str="";
str "", . - .
,
char *str="";
str . strcpy , , .
str "", . str strcpy, undefined, strcpy , . undefined , , - - - segfault ( ) . , undefined.
str?
, else strcpy , , undefined - . , . strcat undefined. , str.