C语言 关于获取最大字符串的问题

#include<stdio.h>
#include<string.h>
#include<conio.h>
#include<string.h>

void main()
{
 char str1[20];
char str2[20];
char str3[20];
int i=0;
printf("请输入第一个字符串:");
gets(str1);
printf("请输入第二个字符串:");
gets(str2);
printf("请输入第三个字符串:");
gets(str3);
if(strcmp(str1,str2)>0)
{char temp[20];
  temp=str;
  str1=str2;
  str1=temp;
}
if(strcmp(str2,str3)>0)
{char temp[20];
  temp=str;
  str2=str3;
  str2=temp;
}
printf("最大值:");
printf("%s",str3);


getch();
}

我想从三个字符串中,获得最大的字符串,通过strcmp判断大小,然后通过数组名(这个相当于地址嘛)完成大小的转换,最后输出最大串,思路没问题的。但是报错
图片说明

为啥子会这样呢?

temp=str;
str2=str3;
str2=temp;
->
strcpy(temp, str2);
strcpy(str2, str3);
strcpy(str3, temp);

temp=str;
str1=str2;
str1=temp;
->
strcpy(temp, str1);
strcpy(str1, str2);
strcpy(str2, temp);

另外,其实并不需要交换
直接
char * max = strcmp(str1, str2) > 0 ? str1 : str2;
if (strcmp(max, str3) < 0) max = str3;
printf("%s", max);
即可。