#include<vector>
#include<iostream>
using namespace std;
class BoxOfProduce
{
private:
vector<string>Produce={"Apples", "Peas","Lemons", "Tomatoes","Peaches","Garlic"};
vector <string>box;//vector to hold the 4 strings
public:
BoxOfProduce(){}//default constructor
void print()
{
for (auto& s : Produce) //displays all strings in vector
{
cout << s << " ";
}
cout<<endl;
}
};
int main()
{
BoxOfProduce Box;
Box.print();//print function
}
В настоящее время пытаюсь найти способ вытащить четыре случайные строки из Produce в коробку. Как я могу рандомизировать Produce и затем отправить строки в коробку?