Writing code like
Date *ptrdate = malloc(12 * sizeof(*ptrdate));
or, a cleaner approach
Date *ptrdate = malloc(12 * sizeof *ptrdate); //sizeof is operator, no need for extra "()"
is more acceptable and desirable as it makes the code more reliable. Even
- type
ptrdatewill be changed in the future - using code along with any external library that has a separate
typedefed Date(create conflict) [#]
You do not need to modify this part of the code.
, main() int main(void).
[#] Mr. @Elias Van Ootegem ]