Home > Back-end >  C language to write their own header file to run
C language to write their own header file to run

Time:09-16

I have these documents together in the same folder
# define Maxsize 100
# define N 2
Typedef struct {
Char number [5].
Char name [20].
int age;
Char sex [5].
Char symptom [50].

} patient;
Typedef patient Elemtype;
H # include "hell."
Int main (void)
{
Patient s;
SequenceList mylist.//order table
int i;
ListInit (& amp; Mylist);//initialization sequence table
for(i=0; i{
The scanf (" % s ", s.n umber);
The scanf (" % s ", s.n ame);
The scanf (" % s ", s.a ge);
The scanf (" % s ", s.s ex);
The scanf (" % s ", s.s ymptom);
ListInsert (& amp; Mylist, I, s);
}
return 0;
}

# include
Typedef struct {
Elemtype list [Maxsize];
int size;
} SequenceList;
Void ListInit (SequenceList * L);//initialization sequence table
Int ListLength SequenceList (L);//calculate the length of the sequence table
Int ListInsert (SequenceList * L, int I, Elemtype x);//insert
Int ListDelete (SequenceList * L, int I Elemtype * x).//delete
Int ListGet (int I SequenceList L, Elemtype * x).//traversal

Void ListInit (SequenceList * L)
{
L-> Size=0;
return;
}
Int ListLength SequenceList (L)
{
Return L.s considering;
}
Int ListInsert (SequenceList * L, int I Elemtype x)
{
Int j;
if(L-> Size==Maxsize)
{
Printf (" sequence table is full can't insert ");
return 0;
}
Else if (i<0 | | i> L-> The size)
{
Printf (" parameters I illegal!" );
return 0;
}
The else
{
For (j=L - & gt; size; J> i; J -)
L-> The list [j]=L - & gt; List] [j - 1;//I location element back
L-> The list [I]=x;
L-> Size++;
return 1;
}

}
Int ListGet (int I SequenceList L, Elemtype * x)
{
If (i<0 | | i> L.s considering 1)
{
Printf (" parameter illegal ");
return 0;
}
The else
{
* x=L.l ist [I];
return 1;
}
}

CodePudding user response:

Above the # define a piece of code there is the main function, and include something omitted

CodePudding user response:

H # include "hell." this is an error

CodePudding user response:

The
reference fat beef ^ * ^ 2 floor response:
# include "hell. H" this line is an error

Error reminder not to file or directory

CodePudding user response:

The include path is not complete
Your makefile INCS combined with the current path. Give it a try

CodePudding user response:

The
INCS=-i "./"-i" C://XXX"

CodePudding user response:

reference 5 floor qybao reply:
or
INCS="./"I - I" C://XXX "

Is behind the INCS=

CodePudding user response:

reference 5 floor qybao reply:
or
INCS="./"I - I" C://XXX "

Can you specific points, how to add

CodePudding user response:

reference 4 floor qybao response:
the include path is not complete
Try your makefile INCS combined with the current path.

And after add the path
  • Related