运行后说error C2275:'list' :illegal use of this type as an expression#include#include #define max 100typedef struct{\x09int *data;\x09int length;}list;init(list &l){\x09l.data=(int*) malloc (max*sizeof (int));\x09if(!l.data)return 0;\x09l.length=

来源:学生作业帮助网 编辑:作业帮 时间:2024/10/06 17:44:31
运行后说error C2275:'list' :illegal use of this type as an expression#include#include #define max 100typedef struct{\x09int *data;\x09int length;}list;init(list &l){\x09l.data=(int*) malloc (max*sizeof (int));\x09if(!l.data)return 0;\x09l.length=
xn@_eHEk')+!DmcLnWZ֫ PUA"@HP!$h6~ ^Bqwgca:O1+.n,lbBv@`(,@d4b c CT~a%D#p,I+ $eL%4@ny#nNVK+;*r!-ڴ1!,])-^lE9os$B5]7~V^i\sI\3c S,آoU trg=YD\"->+*#- e{>sq=L[N/}wh!ZVjy15WL߭X[HN&ۻ'jzBM'Ϧ( zgaaiTXΏ'"YҴ{~}tw!z0Nfc|ez<_gupu h/C^

运行后说error C2275:'list' :illegal use of this type as an expression#include#include #define max 100typedef struct{\x09int *data;\x09int length;}list;init(list &l){\x09l.data=(int*) malloc (max*sizeof (int));\x09if(!l.data)return 0;\x09l.length=
运行后说error C2275:'list' :illegal use of this type as an expression
#include
#include
#define max 100
typedef struct{
\x09int *data;
\x09int length;
}list;
init(list &l)
{
\x09l.data=(int*) malloc (max*sizeof (int));
\x09if(!l.data)return 0;
\x09l.length=0;
\x09return 1;
}
insert(list &l,int p,int e)
{
\x09int i;
\x09if(pl.length+1)
\x09\x09return 0;
\x09for (i=l.length;i>=p;--i)
\x09\x09l.data[i+1]=l.data[i];
\x09l.data[p]=e;
\x09++(l.length);
\x09return 1;
}
void main ()
{
\x09list &l;int i;
init(list &l);
printf("你要输入多少个数据/n");
scanf ("%d",&l.length);
printf("输入元素中/n");
for(i=1;i

运行后说error C2275:'list' :illegal use of this type as an expression#include#include #define max 100typedef struct{\x09int *data;\x09int length;}list;init(list &l){\x09l.data=(int*) malloc (max*sizeof (int));\x09if(!l.data)return 0;\x09l.length=
init(list &l);调用函数时,参数前不用传参数类型,用init(&l)即可