STL console of commodity management system
no vote
STL implementation of commodity management system & nbsp; console. Commodity addition, deletion, second-hand commodity, management, overseas commodity. Sort. Price. The commodity management class commoditymanage implements the management of the commodity data set in the shopping basket, including the commodity pointer as the data member (pointing to the dynamically allocated commodity array), which realizes the operation of adding and removing commodities. Dynamic array dynamically allocates memory according to the initial size when it is created. When the allocated memory is full, it dynamically expands the capacity. Add goods to the shopping basket: to simplify the processing, add new goods to the end of the existing data, and add 1 to the quantity of goods. If the ID of the added goods already exists, only add up the purchase quantity. Delete product from shopping basket: according to the product ID specified by the user, find out whether the product with the specified ID exists. If it exists, delete the corresponding product information. If it does not exist, prompt information. After deleting the product successfully, the product quantity will be reduced by 1. View specified commodity: according to the commodity ID specified by the user