You could keep track of all the orders using a vector:
struct Product {
//Add additional fields you need here
int quant;
int cost;
int selling;
int profit;
};
int main() {
std::vector<Product> products;
while (stillAddingProducts) {
//Get all the data from the user
Product p;
p.quant = 10; //example you should get this from the user
//Insert the product based on the information received
products.push_back(p);
}
//Perhaps iterate through all products and display information
for (const auto& e : products) {
std::cout << "Quantity: " << e.quant << std::endl;
}
}
With this you will have a 'fresh' Product object every iteration. On a sidenote, try to avoid using goto
in your code.