Home > Back-end >  The order of the linear table storage structure
The order of the linear table storage structure

Time:11-28

Why complains about this for a program, the main function of useless pointer for data transfer
# include & lt; stdio.h>
# define Size 10//define the array Size

Typedef struct line
{
The int data [Size];
Int Length;//the number of data in the current array
} the Line;

Void Creat (Line L, int len);//the first parameter to the linear table, the second parameter to the number of input data
Void Print (Line L, int len);//output data

Int main ()
{
The Line Lin;
Creat (Lin, 5);
Print (Lin, 5);

getchar();
getchar();
return 0;
}

CodePudding user response:

What is wrong? How to Creat and Print function?

CodePudding user response:

Some code can post all of the building Lord,

From the data structure and parameter type, the first parameter to Creat function should pass & amp; Lin can, of course, the first argument should be the Line in function definitions * L,
Otherwise can't get what you want from the Creat function data,

CodePudding user response:

At the end of the day is still preach value and the address of the problem

CodePudding user response:

Should the current code, nothing wrong, structure of also can do the incoming parameters, just use the less
  • Related