|
When should I return DATATYPE_OUT_OF_MEM? In which functions? |
The DATATYPE_OUT_OF_MEM result can be returned from any function which allocates memory, in case the allocation fails. It can be returned at any stage of the function. You must make sure that there are no memory leaks, and that the data type is left in a valid state (i.e. can be worked on and destroyed properly).
|
Should I open or close the file in the output functions which receive FILE*? What can I assume? |
The functions which receive FILE* receive a file which was already opened. They should not open any files, and must not close the file that they receive. You can assume that the received file has write access (e.g. opened with mode "w" or "a"), and there's no need to check for write failures.
|
Can I include additional libraries, such as string.h? Where can I include them? |
You can include any library which you have seen in class. You should do this in your .c files, as you cannot modify the .h file of the first data type.
|
Can I use the math.h library? |
You can, but you shouldn't need to. Notes: 1. We won't be using the -lm gcc flag, so the functionality that you'd like to use might not be available. 2. Be careful while using floating point numbers (float/double), as they don't always yield precise results.
|
What can be changed in the file pokemon_trainer.h? |
You must fill the fields in the pokemon_trainer_t structure. You must add documentation, as specified in 3.4.3. You can add additional types. You cannot add additional function signatures, or change existing signatures. You shouldn't need to change anything else in the file.
|
Are the names of the Pokemon/moves/trainers case sensitive? |
All of the names in the assignment are case sensitive.
|
|