Website Summary Files Commits Branches @commit @diff @stats
path: root / Week03 / Exercise01 / Product.h
blob: 6707bc12218a495787f82b75f1cfeeb00a332004 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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