diff options
Diffstat (limited to 'week07/Exercise1.h')
| -rw-r--r-- | week07/Exercise1.h | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/week07/Exercise1.h b/week07/Exercise1.h new file mode 100644 index 0000000..6de1a09 --- /dev/null +++ b/week07/Exercise1.h @@ -0,0 +1,25 @@ +struct Ingredient { + char name[512]; + float amount; +}; + +class Recipe { + Ingredient* ingredients; + unsigned lastIndex; + unsigned allocated; + + void resize(); + void free(); + void copyFrom(const Recipe& other); + +public: + Recipe(); + ~Recipe(); + Recipe(const Recipe& other); + Recipe& operator=(const Recipe& other); + Recipe(Recipe&& other); + Recipe& operator=(Recipe&& other); + + void AddIngredient(const Ingredient& newIng); + void RemoveIngredient(const char* name); +}; |
