icp/oer/courses/c-basics/sections/12-struct_enum/01-enums/content.html

14 lines
714 B
HTML

<p>
Until now you didn't have any way to define your own types or store information about state in a readable way.
The most simple construct to do that are enums.
Enums are enumeration types, meaning they are basicly ints but they allow you to use a name instead of numbers.
The compiler will then translate those names in numbers.
</p>
<p>
This is usefull, because you see at a glance, what you want to say with your code, instead of trying to find out, what a 4 means in this case.
Also if you want to change anything about your enum, you only have to change it in the definition, except you change the names.
</p>
<p>
Write a function, which returns the number of days to the specified one.
</p>