Hello, and welcome back.
We're going to have our first challenge for structures.
Let's begin.
This is going to help you understand structures; how to
declare them and initialize them.
So I want you to write a program that declares a structure
and prints out its content.
We should know how to declare a structure.
We use the struct keyword, and then we have the tag name.
And then inside the structure, we can put different elements.
So I want you to create an employee structure that would
be the tag name with three members: a name which should be
a character array, it doesn't have to be a character pointer.
A hire date which is an int and a salary which should be of type float.
I want you to declare and initialize an instance of the employee type,
so you should use destruct and then you're going to have to know how
to initialize members in a struct.
I then want you to actually read in from the console three inputs.
The name, the hire date and the salary and then stored in the
same structure type of the one that you previously initialized.
But before you stored in the type that you initialized,
I want you to print it out.
So you create your first structure, you initialize it,
you print out the contents.
And then you read from the keyboard three more instances of data
and put that in the employing type and then print that out.
So this isn't a pointer.
So when you read it in from the input, you're going to have to use the
address of operator, things like that.
But the rest is pretty straightforward.
But this will get you familiar with, again, creating a structure,
defining it and then initializing it and creating an instance of it.
When you define the structure, you can define it outside of the
main method, so that it can be used by any other function that's
typical standard convention.
So good luck.
This should be pretty straightforward.
We'll have another challenge to get a little more detail.
We'll pass a structure to a function and so forth, but this
is just going to get you started. Thank you.