Website Summary Files Commits Branches @commit @diff @stats
path: root / Week03 / Exercise01 / Product.h
diff options
context:
space:
mode:
1 files changed, 22 insertions, 0 deletions
-rw-r--r--Week03/Exercise01/Product.h22
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