transgalactic
- 1,386
- 0
first i create this structure :
if i want my variables not to be global
i can write this inside main:
struct album CD1, CD2, CD3;
or
"
typedef struct album Album;
... then inside main:
Album CD1, CD2, CD3; "
i can't understand this last part regarding where to write the typedef line
and what is the role of type of typedef?
Code:
struct album {
char *name;
char *artist;
int numTracks;
}
if i want my variables not to be global
i can write this inside main:
struct album CD1, CD2, CD3;
or
"
typedef struct album Album;
... then inside main:
Album CD1, CD2, CD3; "
i can't understand this last part regarding where to write the typedef line
and what is the role of type of typedef?