#include
# define a 10
Typedef struct
{
Int * data;
Int length;
Int Maxsize;
} SqeList;
Int main ()
{
SqeList L;
Insert (L);
return 0;
}
Void Insert (SqeList& L)
{
L.d ata (int *)=https://bbs.csdn.net/topics/malloc (a * sizeof (int));
L.l ength=0;
"Axsize=10;
}
CodePudding user response:
After function is written in the main function, must be first life function prototype,CodePudding user response:
Function declarations to before, and modified as follows, for reference:# include
#include
# define a 10
Typedef struct
{
Int * data;
Int length;
Int Maxsize;
} SqeList;
Void Insert (SqeList& L);//function declarations in the former
Int main ()
{
SqeList L;
Insert (L);//call in the
return 0;
}
Void Insert (SqeList& L)
{
L.d ata (int *)=https://bbs.csdn.net/topics/malloc (a * sizeof (int));
L.l ength=0;
"Axsize=10;
}
CodePudding user response:
The function called after the main function of words need to declare, not beforeCodePudding user response:
# include
#include
# define MAX_SIZE 10
Typedef struct
{
Int * data;
Int length;
Int Maxsize;
} SqeList;
Void Insert (SqeList& L);
Int main ()
{
SqeList L;
Insert (L);
return 0;
}
Void Insert (SqeList& L)
{
L.d ata (int *)=https://bbs.csdn.net/topics/malloc (MAX_SIZE * sizeof (int));
L.l ength=0;
//"axsize=10;
"Axsize=MAX_SIZE;
}
For your reference ~