请哪位大侠帮忙看一下,为什么我的程序老是提示error C2106: '=' : left operand must be l-value
麻烦哪位高手帮忙看一下,谢谢了#include<stdio.h>
#include<string.h>
//#include<math.h>
//#define uint unsigned int
//#define N 10
int sort(char (*p)[5])
{
int i;
char p1[5];
// p1 = NULL;
for (i=0; i<3; i++)
{
if (strcmp(*(p+i),*(p+i+1))>0)
{
p1 = *(p+i);
*(p+i) = *(p+i+1);
*(p+i+i) = p1;
}
}
return 0;
}
int main(void)
{
int i;
char a[5][5];
printf("please input five string\n");
for (i=0; i<5; i++)
{
scanf("%s",a[i]);
}
sort(a);
for (i=0; i<5; i++)
{
printf("%s\n",a[i]);
}
return 0;
}
提示
--------------------Configuration: pointerasvar - Win32 Debug--------------------
Compiling...
pointerasvar.c
D:\我的文档\桌面\C语言代码\pointerasvar.c(18) : error C2106: '=' : left operand must be l-value
D:\我的文档\桌面\C语言代码\pointerasvar.c(19) : error C2106: '=' : left operand must be l-value
D:\我的文档\桌面\C语言代码\pointerasvar.c(20) : error C2106: '=' : left operand must be l-value
Error executing cl.exe.
pointerasvar.obj - 3 error(s), 0 warning(s)
[ 本帖最后由 xiaodeo 于 2010-10-25 21:51 编辑 ]