Home > Back-end >  C language structure
C language structure

Time:09-19

I c language for beginners hope everybody who can help me with this problem, thank you

CodePudding user response:

Define a structure, the content is said figure 2-1 the serial number, student id, etc.
For example,
Struct student
{
int num;//serial number
Char xh [15].//student id
. .
}

CodePudding user response:

reference 1st floor CHXCHXKKK response:
defines a structure body, said content is figure 2-1 the serial number, student id, etc.
For example,
Struct student
{
int num;//serial number
Char xh [15].//student id
. .
}

Bosses, so I enter student id and can judge right and wrong? Student number 10 digits, I judge each character
for(j=0; J<=9; J++)
{
The scanf (" % c ", & amp; Stu [I]. Xh [j]);
If (stu [I]. Xh [j] <'0' | | stu [I] xh [j] & gt; '9')
{
Xh printf (" error ");
return 0;
}

CodePudding user response:

The string comparison with STRCMP
  • Related