From 5624cd9b63bec13fc464a3d7820d703abd8de113 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Sun, 8 Mar 2026 19:54:32 +0200 Subject: feat(Week03): Add solution to first exercise --- Week03/Exercise01/Product.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 Week03/Exercise01/Product.h (limited to 'Week03/Exercise01/Product.h') diff --git a/Week03/Exercise01/Product.h b/Week03/Exercise01/Product.h new file mode 100644 index 0000000..6707bc1 --- /dev/null +++ b/Week03/Exercise01/Product.h @@ -0,0 +1,22 @@ +#ifndef _PRODUCT +#define _PRODUCT + +struct Product { + char name[256]; + unsigned count; + double price; +}; + +struct ProductArray { + Product* products; + unsigned count; + unsigned allocated; + + void add(const Product& product); + Product* find(char* name); +}; + +ProductArray newProductArray(unsigned allocatedSize); +void deleteProductArray(ProductArray& ua); + +#endif -- cgit v1.3.1-26-gb76a