This will be a pretty short lecture.
But I want to go over a another way to create user defined types and be a very simple way.
And one of ways you can actually rename existing types.
So how you do that is through our keyword typedef
and typedef works like this so you have the keyword type def and then you place your existing type here
and then space and then you have your new type name here.
OK.
So this is kind of the template you use to rename types.
So say you want to rename and ginger to be an ID type instead.
Like for books.
So now I can use id type instead of integers ID type my ID in its for 7 or 8 or.
OK so this is one way you can create a user defined type and you may ask why use this.
What is why and why is this useful at all.
And well theres two main reasons I can think of if you want to use this one.
It helps with readability of your code so you can make it more expressive and follow the language of
the problem better.
But also number two it helps if you say if you say you want to change the type later to something else
you want it to be a noun sine type unsigned int type.
OK.
Well I just change it here once and then all ID types will be updated.
K so this is one nice way to change the readability of your code to make it more of the language of
the problem.
And in the next lecture I want to go over yet one more way to make your own types.