I have two programs written in C. Why does the first program work without malloc, but the second one doesn't unless I use malloc?
Code:int main(){
char * word;
word = "abcde";
printf("You entered: %s\n", word );
}
Code:
int main(){
char * word;
strcpy(word, "abcde");
printf("You entered: %s\n", word );
}