I've written the following C code, but it's not working correctly. Why not? char str1[10]= "abc";char str2[10]= "def";str2 = str1; printf("%s\n",str2);

icon
Related questions
Question
  1. I've written the following C code, but it's not working correctly. Why not?

char str1[10]= "abc";
char str2[10]= "def";
str2 = str1;

printf("%s\n",str2);

AI-Generated Solution
AI-generated content may present inaccurate or offensive content that does not represent bartleby’s views.
steps

Unlock instant AI solutions

Tap the button
to generate a solution