Lets say I have a following structures in c++
struct Fruit
{
std::string name, description;
}
and
struct Fruit Fruits[]
{
{"orange"," Orange is a hybrid of ancient cultivated origin, possibly between pomelo and mandarin. "},
{"apple", " Apple is the pomaceous fruit of the apple tree, species Malus domestica in the rose family. "},
};
My question is, how can I access to all the elements of the single member type of the one struct in c++, or in this case how can I list all the elements of the member type name from the struct Fruit?
Any help would be appreciated. Thanks in advance.
1 Answer