Version 3.0
2
/
3
typedef
4
5
6
struct HERO
{
char name[11];
int grade;
int power;
float salary;
};
7
struct HERO h1;
struct HERO
{
char name[11];
int grade;
int power;
float salary;
} h1,h2;
struct HERO h1;
struct HERO h2;
struct HERO h3,h4;
8
HERO h1 h2
struct HERO
{
char name[11];
int grade;
int power;
float salary;
};
struct HERO h1 = {,3,9915.5};
struct HERO h2 = {,3,100,35.9};
9
2- 1
h1 h2
h2 = h1;
10
,
.
scanf("%s",h1,name);
11
struct issue
{
char borrower [20];
char dt_of_issue[8];
struct cat books;
}issl;
issl.borrower
cat cat issue
issl.books.author
12
#include <stdio.h>
void main()
{
struct student
{
char name[10];
int chinese;
int english;
}score;
printf("");
scanf("%s",&score.name);
printf("");
scanf("%d",&score.chinese);
printf("");
scanf("%d",&score.english)
//
printf("\t\t\n");
printf("%s\t",score.name);
printf("%d\t",score.chinese);
printf("%d\n",score.english);
}//
13
14
15
struct HERO heros[5];
heros power:
heros[2].power
16
struct HERO heros[5] =
{
{,3,99,15.5},
{,3,100,35.9},
{,2,99,32.6}
}
17
*
->
struct HERO *p,h1;
p = &h1;
printf("%s",p->name);
18
typedef
typedef
typedef ;
typedef float deci;
typedef
19
20
21
22
23
24
typedef