I'm creating a billing program for my college's print shop. I'm doing this with a class called "orders" that signifies each new order that is taken. I'm having trouble figuing out how to create new variables of that class without prompting the user to input anything though... After the previous order is finished I want the program to automatically set up for a new order by creating a new variable of type "orders". My problem is figuring out how to make this happen. Here is what I have so far.
orderNumber++; //initialized to zero, type int// std::string index = "order" + stringify(orderNumber); // 'stringify' is a function that converts an integer to a string
So, now i have a nice string variable with a concatenated number to create "order1", "order2" etc. But now I need to use that variable to name a variable of type "orders".
I've heard this can be done with mapping somehow, but I'm not sure how that works at all.