Conteúdo do Curso
C Structs
C Structs
Creating Your First Struct
Using the visual cue at the end of first chapter , let's create a data type to describe a chemical element:
Note
The mass and sequence number cannot be negative, so it would be more efficient to use the
unsigned short int
data type.
Now, we can “create” a chemical element:
The code will look like this:
Access to struct fields will be discussed in the next chapter.
Try to describe the geometric point A
with a structure.
Tarefa
- Create a structure named
Point
; - Create a field for the name of the future point;
- Create fields for the
X
andY
coordinates.
Obrigado pelo seu feedback!
Creating Your First Struct
Using the visual cue at the end of first chapter , let's create a data type to describe a chemical element:
Note
The mass and sequence number cannot be negative, so it would be more efficient to use the
unsigned short int
data type.
Now, we can “create” a chemical element:
The code will look like this:
Access to struct fields will be discussed in the next chapter.
Try to describe the geometric point A
with a structure.
Tarefa
- Create a structure named
Point
; - Create a field for the name of the future point;
- Create fields for the
X
andY
coordinates.
Obrigado pelo seu feedback!
Creating Your First Struct
Using the visual cue at the end of first chapter , let's create a data type to describe a chemical element:
Note
The mass and sequence number cannot be negative, so it would be more efficient to use the
unsigned short int
data type.
Now, we can “create” a chemical element:
The code will look like this:
Access to struct fields will be discussed in the next chapter.
Try to describe the geometric point A
with a structure.
Tarefa
- Create a structure named
Point
; - Create a field for the name of the future point;
- Create fields for the
X
andY
coordinates.
Obrigado pelo seu feedback!
Using the visual cue at the end of first chapter , let's create a data type to describe a chemical element:
Note
The mass and sequence number cannot be negative, so it would be more efficient to use the
unsigned short int
data type.
Now, we can “create” a chemical element:
The code will look like this:
Access to struct fields will be discussed in the next chapter.
Try to describe the geometric point A
with a structure.
Tarefa
- Create a structure named
Point
; - Create a field for the name of the future point;
- Create fields for the
X
andY
coordinates.