Suppose we have:
struct elements{ string drink_name; double price_per_can; double number_in_machine; }; struct elements machine[6]; And machine is populated in main(). How do I pass machine into a function (by reference) to be used inside the function?
std::arrayinstead of a naked fixed length array.